trait HasOneOrManyPolymorphicTrait

Has one or has many polymorphic relation.

Properties

protected string $polymorphicType Polymorphic type.

Methods

__construct(Connection $connection, ORM $origin, ORM $model, string $polymorphicType)

Constructor.

ORM
create(array|ORM $related)

Creates a related record.

Details

at line 33
__construct(Connection $connection, ORM $origin, ORM $model, string $polymorphicType)

Constructor.

Parameters

Connection $connection Database connection
ORM $origin Originating model
ORM $model Related model
string $polymorphicType Polymorphic type

at line 48
ORM create(array|ORM $related)

Creates a related record.

Parameters

array|ORM $related Related record

Return Value

ORM