Row
Row
Properties
adapter
private Adapter $adapter
public $
changedProperties
private array $changedProperties
propertyMeta
private array $propertyMeta
Methods
prepare
Prepare the row values by checking for fields that are an array that should not be.
public prepare({Array})
This will happen when a join selects multiple fields from different tables with the same name. For example, when doing a SELECT * with multiple tables that all have an 'id' column. The 'id' columns from each table will clobber the earlier value as each table is processed, meaning the Row::update() may not work. To get around this, the Row class is given data using the \PDO::FETCH_NAMED flag which will cause multiple columns with the same name to be returned as an array. However, the column will not have an array data type so we detect that and just grab the first value in the array.
Parameters
Parameter | Type | Description |
---|---|---|
$data | array |
update
Update the database with any changes to the current row, optionally providing updates directly.
public update({Array})
Parameters
Parameter | Type | Description |
---|---|---|
$data | array | Column updates that will be applied to the object directly |
construct
Row constructor.
protected construct({Array})
Parameters
Parameter | Type | Description |
---|---|---|
$data | array | |
$adapter | Adapter | |
$meta | array | |
$statement | \PDOStatement |
constructed
protected constructed({Array})
Parameters
Parameter | Type | Description |
---|---|---|
$data | array |
Generated by Hazaar API Doc Generator