just another orm...
View the Project on GitHub tflori/orm
» API Reference » ORM\Relation
| Name | Value |
|---|---|
| OPT_CLASS | 'class' |
| OPT_MORPH_COLUMN | 'morphColumn' |
| OPT_MORPH | 'morph' |
| OPT_REFERENCE | 'reference' |
| OPT_CARDINALITY | 'cardinality' |
| OPT_OPPONENT | 'opponent' |
| OPT_TABLE | 'table' |
| OPT_FILTERS | 'filters' |
| CARDINALITY_ONE | 'one' |
| CARDINALITY_MANY | 'many' |
public function addRelated(
\ORM\Entity $self,
\ORM\Entity[] $entities,
\ORM\EntityManager $entityManager,
): mixed
| Returns | mixed | |
| Throws | ORM\Exception\InvalidRelation |
| Parameter | Type | Description |
|---|---|---|
$self |
ORM\Entity | |
$entities |
ORM\Entity[] | |
$entityManager |
ORM\EntityManager |
ORM\Relation::addRelated
public static function createRelation(
string $parent,
string $name,
array $relDef,
): \ORM\Relation
| Static | This method is static. | |
| Returns | ORM\Relation | |
| Throws | ORM\Exception\InvalidConfiguration |
| Parameter | Type | Description |
|---|---|---|
$parent |
string | |
$name |
string | |
$relDef |
array |
ORM\Relation::createRelation
public function deleteRelated(
\ORM\Entity $self,
\ORM\Entity[] $entities,
\ORM\EntityManager $entityManager,
): mixed
| Returns | mixed | |
| Throws | ORM\Exception\InvalidRelation |
| Parameter | Type | Description |
|---|---|---|
$self |
ORM\Entity | |
$entities |
ORM\Entity[] | |
$entityManager |
ORM\EntityManager |
ORM\Relation::deleteRelated
public function eagerLoad(\ORM\EntityManager $em, \ORM\Entity $entities): mixed
| Returns | mixed |
| Parameter | Type | Description |
|---|---|---|
$em |
ORM\EntityManager | |
$entities |
ORM\Entity |
ORM\Relation::eagerLoad
abstract public function fetch(
\ORM\Entity $self,
\ORM\EntityManager $entityManager,
): mixed
Runs fetch on the EntityManager and returns its result.
| Returns | mixed |
| Parameter | Type | Description |
|---|---|---|
$self |
ORM\Entity | |
$entityManager |
ORM\EntityManager |
ORM\Relation::fetch
public function fetchAll(
\ORM\Entity $self,
\ORM\EntityManager $entityManager,
): \ORM\Entity[]|\ORM\Entity
Runs fetch and returns EntityFetcher::all() if a Fetcher is returned.
| Returns | ORM\Entity[]|ORM\Entity |
| Parameter | Type | Description |
|---|---|---|
$self |
ORM\Entity | |
$entityManager |
ORM\EntityManager |
ORM\Relation::fetchAll
public function setRelated(
\ORM\Entity $self,
?\ORM\Entity $entity = null,
): mixed
| Returns | mixed | |
| Throws | ORM\Exception\InvalidRelation |
| Parameter | Type | Description |
|---|---|---|
$self |
ORM\Entity | |
$entity |
?ORM\Entity |
ORM\Relation::setRelated