Copied!

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 PHPFUI\ORM\VirtualField::__construct(PHPFUI\ORM\Record $currentRecord, string $fieldName)
public delete(array $parameters) : void
 
  • param string[] $parameters
public getValue(array $parameters) : PHPFUI\ORM\RecordCursor
 
  • param array<string,string> $parameters containing \PHPFUI\ORM\Children::class followed by the child table, then the optional parameters of an order by column and sort order (defaults to ASC).
public PHPFUI\ORM\VirtualField::setValue(?mixed $value, array $parameters) : void
 
  • param array $parameters optional
Properties
protected PHPFUI\ORM\Record PHPFUI\ORM\VirtualField::$currentRecord
protected string PHPFUI\ORM\VirtualField::$fieldName
Methods
protected getTable(string $class) : PHPFUI\ORM\Table
© 2025 Bruce Wells
Search Namespaces \ Classes
Configuration