trait HasOneOrManyPolymorphicTrait

Has one or has many polymorphic relation.

Properties

protected string $polymorphicType Polymorphic type.

Methods

__construct(Connection $connection, ORM $parent, ORM $related, string $polymorphicType)

Constructor.

ORM
create(ORM|array $related)

Creates a related record.

Details

at line 35
__construct(Connection $connection, ORM $parent, ORM $related, string $polymorphicType)

Constructor.

Parameters

Connection $connection Database connection
ORM $parent Parent model
ORM $related 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