Reference extends Relation
Reference field describes relation 1-to-1 or 1-to-many between two entities
Tags
Table of Contents
Constants
- ELEMENTAL_BOTH = 3
- ELEMENTAL_REF = 2
- ELEMENTAL_THIS = 1
Methods
- __construct() : mixed
- addFetchDataModifier() : $this
- addSaveDataModifier() : $this
- addValidator() : $this
- configureCascadeDeletePolicy() : Relation
- configureCascadeSavePolicy() : Relation
- configureJoinType() : $this
- configureSerialized() : $this
- configureTitle() : $this
- Lang phrase
- getCascadeDeletePolicy() : int
- getCascadeSavePolicy() : int
- getClassByOldDataType() : bool
- getConnection() : Connection
- getDataType() : null|string
- getElementals() : array<string|int, mixed>|bool
- Returns set of strictly linked fields of this and ref entities [localFieldName => remoteFieldName]
- getEntity() : mixed
- getFetchDataModifiers() : array<string|int, mixed>|array<string|int, callable>|null
- getGetterTypeHint() : EntityObject|string
- getJoinType() : string
- getLangCode() : mixed
- getName() : mixed
- getOldDataTypeByClass() : bool
- getOldDataTypeByField() : bool
- getParameter() : mixed
- getParentField() : Field
- getRefEntity() : Entity
- getRefEntityName() : string
- getReference() : mixed
- getSaveDataModifiers() : array<string|int, mixed>|array<string|int, callable>|null
- getSetterTypeHint() : EntityObject|string
- getTitle() : mixed
- getTypeMask() : mixed
- getValidators() : array<string|int, callable>|array<string|int, Validator>
- hasParameter() : mixed
- isSerialized() : bool
- modifyValueBeforeSave() : mixed
- postInitialize() : null
- Called after being initialized by Entity
- resetEntity() : mixed
- serialize() : mixed
- setConnection() : mixed
- setEntity() : mixed
- setName() : mixed
- setParameter() : mixed
- setParentField() : mixed
- setSerialized() : mixed
- unserialize() : mixed
- validateValue() : Result
Constants
ELEMENTAL_BOTH
public
mixed
ELEMENTAL_BOTH
= 3
ELEMENTAL_REF
public
mixed
ELEMENTAL_REF
= 2
ELEMENTAL_THIS
public
mixed
ELEMENTAL_THIS
= 1
Methods
__construct()
public
__construct(string $name, string|Entity $referenceEntity, array<string|int, mixed>|ConditionTree $referenceFilter[, array<string|int, mixed> $parameters = array() ]) : mixed
Parameters
- $name : string
- $referenceEntity : string|Entity
- $referenceFilter : array<string|int, mixed>|ConditionTree
- $parameters : array<string|int, mixed> = array()
-
deprecated, use configure* and add* methods instead
Tags
addFetchDataModifier()
public
addFetchDataModifier(callable $modifier) : $this
Parameters
- $modifier : callable
Tags
Return values
$thisaddSaveDataModifier()
public
addSaveDataModifier(callable $modifier) : $this
Parameters
- $modifier : callable
Tags
Return values
$thisaddValidator()
public
addValidator(Validator|callable $validator) : $this
Parameters
- $validator : Validator|callable
Tags
Return values
$thisconfigureCascadeDeletePolicy()
public
configureCascadeDeletePolicy(int $cascadeDeletePolicy) : Relation
Parameters
- $cascadeDeletePolicy : int
Return values
RelationconfigureCascadeSavePolicy()
public
configureCascadeSavePolicy(int $cascadeSavePolicy) : Relation
Parameters
- $cascadeSavePolicy : int
Return values
RelationconfigureJoinType()
public
configureJoinType(mixed $type) : $this
Parameters
- $type : mixed
Tags
Return values
$thisconfigureSerialized()
public
configureSerialized() : $this
Tags
Return values
$thisconfigureTitle()
Lang phrase
public
configureTitle(mixed $title) : $this
Parameters
- $title : mixed
Return values
$thisgetCascadeDeletePolicy()
public
getCascadeDeletePolicy() : int
Return values
intgetCascadeSavePolicy()
public
getCascadeSavePolicy() : int
Return values
intgetClassByOldDataType()
public
static getClassByOldDataType(mixed $dateType) : bool
Parameters
- $dateType : mixed
Return values
boolgetConnection()
public
getConnection() : Connection
Tags
Return values
ConnectiongetDataType()
public
getDataType() : null|string
Return values
null|stringgetElementals()
Returns set of strictly linked fields of this and ref entities [localFieldName => remoteFieldName]
public
getElementals() : array<string|int, mixed>|bool
Return values
array<string|int, mixed>|boolgetEntity()
public
getEntity() : mixed
getFetchDataModifiers()
public
getFetchDataModifiers() : array<string|int, mixed>|array<string|int, callable>|null
Tags
Return values
array<string|int, mixed>|array<string|int, callable>|nullgetGetterTypeHint()
public
getGetterTypeHint() : EntityObject|string
Tags
Return values
EntityObject|stringgetJoinType()
public
getJoinType() : string
Return values
stringgetLangCode()
public
getLangCode() : mixed
getName()
public
getName() : mixed
getOldDataTypeByClass()
public
static getOldDataTypeByClass(mixed $class) : bool
Parameters
- $class : mixed
Return values
boolgetOldDataTypeByField()
public
static getOldDataTypeByField(Field $field) : bool
Parameters
- $field : Field
Return values
boolgetParameter()
public
getParameter(mixed $name) : mixed
Parameters
- $name : mixed
getParentField()
public
getParentField() : Field
Return values
FieldgetRefEntity()
public
getRefEntity() : Entity
Tags
Return values
EntitygetRefEntityName()
public
getRefEntityName() : string
Return values
stringgetReference()
public
getReference() : mixed
getSaveDataModifiers()
public
getSaveDataModifiers() : array<string|int, mixed>|array<string|int, callable>|null
Tags
Return values
array<string|int, mixed>|array<string|int, callable>|nullgetSetterTypeHint()
public
getSetterTypeHint() : EntityObject|string
Tags
Return values
EntityObject|stringgetTitle()
public
getTitle() : mixed
getTypeMask()
public
getTypeMask() : mixed
getValidators()
public
getValidators() : array<string|int, callable>|array<string|int, Validator>
Tags
Return values
array<string|int, callable>|array<string|int, Validator>hasParameter()
public
hasParameter(mixed $name) : mixed
Parameters
- $name : mixed
isSerialized()
public
isSerialized() : bool
Return values
boolmodifyValueBeforeSave()
public
modifyValueBeforeSave(mixed $value, mixed $data) : mixed
Parameters
- $value : mixed
- $data : mixed
Tags
postInitialize()
Called after being initialized by Entity
public
postInitialize() : null
Return values
nullresetEntity()
public
resetEntity() : mixed
serialize()
public
serialize(mixed $value) : mixed
Parameters
- $value : mixed
setConnection()
public
setConnection(mixed $connection) : mixed
Parameters
- $connection : mixed
setEntity()
public
setEntity(Entity $entity) : mixed
Parameters
- $entity : Entity
Tags
setName()
public
setName(mixed $name) : mixed
Parameters
- $name : mixed
setParameter()
public
setParameter(mixed $name, mixed $value) : mixed
Parameters
- $name : mixed
- $value : mixed
setParentField()
public
setParentField(Field $parentField) : mixed
Parameters
- $parentField : Field
setSerialized()
public
setSerialized() : mixed
Tags
unserialize()
public
unserialize(mixed $value) : mixed
Parameters
- $value : mixed
validateValue()
public
validateValue(mixed $value, mixed $primary, mixed $row, Result $result) : Result
Parameters
- $value : mixed
- $primary : mixed
- $row : mixed
- $result : Result