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(ORM|array $related)

Creates a related record.

Details

at line 35
__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 50
ORM create(ORM|array $related)

Creates a related record.

Parameters

ORM|array $related Related record

Return Value

ORM