Doctrine


Doctrine\ORM\Mapping\OneToOneMapping
/Doctrine/ORM/Mapping/OneToOneMapping.php at line 43

Class OneToOneMapping

Class:OneToOneMapping - Superclass: AssociationMapping
AssociationMapping
⌊ OneToOneMapping

public class OneToOneMapping
extends AssociationMapping

A one-to-one mapping describes a uni-directional mapping from one entity to another entity.

IMPORTANT NOTE:

The fields of this class are only public for 2 reasons: 1) To allow fast READ access. 2) To drastically reduce the size of a serialized instance (private/protected members get the whole class name, namespace inclusive, prepended to every property in the serialized representation).

Instances of this class are stored serialized in the metadata cache together with the owning ClassMetadata instance.

Since:
2.0
Author:
Roman Borschel
Giorgio Sironi

Field Summary
array

$joinColumnFieldNames

READ-ONLY: A map of join column names to field names that are used in cases when the join columns are fetched as part of the query result.

array

$joinColumns

READ-ONLY: The join column definitions.

boolean

$orphanRemoval

READ-ONLY: Whether to delete orphaned elements (when nulled out, i.e.

mixed

$sourceToTargetKeyColumns

READ-ONLY: Maps the source foreign/primary key columns to the target primary/foreign key columns.

mixed

$targetToSourceKeyColumns

READ-ONLY: Maps the target primary/foreign key columns to the source foreign/primary key columns.

Fields inherited from Doctrine\ORM\Mapping\AssociationMapping
FETCH_EAGER, FETCH_LAZY, declared, fetchMode, inherited, inversedBy, isCascadeDetach, isCascadeMerge, isCascadePersist, isCascadeRefresh, isCascadeRemove, isOwningSide, joinTable, mappedBy, sourceEntityName, sourceFieldName, targetEntityName
Method Summary
boolean

isOneToOne()

{@inheritdoc}

void

load(object sourceEntity, object targetEntity, EntityManager em, array joinColumnValues, object target)

{@inheritdoc}

Methods inherited from Doctrine\ORM\Mapping\AssociationMapping
getQuotedJoinTableName, hasCascades, isEagerlyFetched, isLazilyFetched, isManyToMany, isOneToMany, isOneToOne, load, usesJoinTable

Field Detail

/Doctrine/ORM/Mapping/OneToOneMapping.php at line 79

joinColumnFieldNames

public array $joinColumnFieldNames = array()

READ-ONLY: A map of join column names to field names that are used in cases when the join columns are fetched as part of the query result.


/Doctrine/ORM/Mapping/OneToOneMapping.php at line 71

joinColumns

public array $joinColumns = array()

READ-ONLY: The join column definitions. Only present on the owning side.


/Doctrine/ORM/Mapping/OneToOneMapping.php at line 64

orphanRemoval

public boolean $orphanRemoval = false

READ-ONLY: Whether to delete orphaned elements (when nulled out, i.e. $foo->other = null)


/Doctrine/ORM/Mapping/OneToOneMapping.php at line 50

sourceToTargetKeyColumns

public mixed $sourceToTargetKeyColumns = array()

READ-ONLY: Maps the source foreign/primary key columns to the target primary/foreign key columns. i.e. source.id (pk) => target.user_id (fk). Reverse mapping of _targetToSourceKeyColumns.


/Doctrine/ORM/Mapping/OneToOneMapping.php at line 57

targetToSourceKeyColumns

public mixed $targetToSourceKeyColumns = array()

READ-ONLY: Maps the target primary/foreign key columns to the source foreign/primary key columns. i.e. target.user_id (fk) => source.id (pk). Reverse mapping of _sourceToTargetKeyColumns.


Method Detail

/Doctrine/ORM/Mapping/OneToOneMapping.php at line 126

isOneToOne

public boolean isOneToOne()

Override.

/Doctrine/ORM/Mapping/OneToOneMapping.php at line 139

load

public void load(object sourceEntity, object targetEntity, EntityManager em, array joinColumnValues, object target)

Parameters:
sourceEntity - the entity source of this association
targetEntity - the entity to load data in
joinColumnValues - Values of the join columns of $sourceEntity.

Doctrine