The Children class allows you to easily get the children records for any field of a Record.
In the Record class definition, you need to define a virtual field with the name of the child relationship. The key of the virtual field is the member name and the value is an array.
The values in the array should be \PHPFUI\ORM\Children::class followed by the child table, then the optional parameters of an order by column and sort order (defaults to ASC).
Example:
protected static array $virtualFields = [
'orderDetailChildren' => [\PHPFUI\ORM\Children::class, \Tests\App\Table\OrderDetail::class, 'data_allocated', 'desc'],
];
CloneableInstantiable
Methods |
public delete(array $parameters) : void
|
public getValue(array $parameters) : PHPFUI
|
Properties |
Methods |
protected getTable(string $class) : PHPFUI |