| Methods |
public
|
__construct(string $link)
|
#
|
public
|
setOwner(Model $owner): $this
|
#
|
protected
|
assertReferenceValueNotNull(mixed $value): void
|
#
|
public
|
getOurFieldName(): string
|
#
|
final
protected
|
getOurField(): Field
|
#
|
final
protected
|
getOurFieldValue(Model $ourEntity): mixed
|
#
|
public
|
getTheirFieldName(Model $theirModel = null): string
|
#
|
protected
|
onHookToOurModel<T is Model>(
Model $model,
string $spot,
Closure(T, mixed, mixed, mixed, mixed, mixed, mixed, mixed, mixed, mixed, mixed): mixed $fx,
array<int, mixed> $args = [],
int $priority = 5,
): int
|
#
|
protected
|
onHookToTheirModel(
Model $model,
string $spot,
Closure(Model, mixed, mixed, mixed, mixed, mixed, mixed, mixed, mixed, mixed, mixed): mixed $fx,
array<int, mixed> $args = [],
int $priority = 5,
): int
|
#
|
protected
|
init(): void
|
#
|
public
|
getDesiredName(): string
Will use #ref-<link>.
|
#
|
public
|
getOurModel(?Model $ourModel): Model
|
#
|
public
|
createTheirModel(array<string, mixed> $defaults = []): Model
Create destination model that is linked through this reference. Will apply
necessary conditions.
Create destination model that is linked through this reference. Will apply
necessary conditions.
IMPORTANT: the returned model must be a fresh clone or freshly built from a seed
|
#
|
protected
|
initTableAlias(): void
|
#
|
protected
|
addToPersistence(Model $theirModel, array<string, mixed> $defaults = []): void
|
#
|
protected
|
getDefaultPersistence(Model $theirModel): Persistence|false
Returns default persistence for theirModel.
Returns default persistence for theirModel.
Overriden by
|
#
|
public
|
ref(Model $ourModel, array<string, mixed> $defaults = []): Model
Returns referenced model without any extra conditions. However other
relationship types may override this to imply…
Returns referenced model without any extra conditions. However other
relationship types may override this to imply conditions.
Overriden by
|
#
|
public
|
refModel(Model $ourModel, array<string, mixed> $defaults = []): Model
Returns referenced model without any extra conditions. Ever when extended
must always respond with Model that does not…
Returns referenced model without any extra conditions. Ever when extended
must always respond with Model that does not look into current record
or scope.
|
#
|
public
|
__debugInfo(): array<string, mixed>
|
#
|
public
|
getOwner(): Model
our model
|
#
|
| Properties |
protected
|
string
|
$tableAlias
|
#
|
public
|
string
|
$link
|
#
|
public
|
Model|(Closure(object, static, array<string, mixed>): Model)|array<mixed>
|
$model
|
#
|
protected
|
?string
|
$ourField = null
This is an optional property which can be used by your implementation
to store field-level relationship based on a…
This is an optional property which can be used by your implementation
to store field-level relationship based on a common field matching.
|
#
|
protected
|
?string
|
$theirField = null
This is an optional property which can be used by your implementation
to store field-level relationship based on a…
This is an optional property which can be used by your implementation
to store field-level relationship based on a common field matching.
|
#
|
public
|
bool
|
$checkTheirType = true
Database our/their field types must always match, but DBAL types can be different in theory,
set this to false when the…
Database our/their field types must always match, but DBAL types can be different in theory,
set this to false when the DBAL types are intentionally different.
|
#
|
public
|
string|null
|
$caption
|
#
|