Class BelongsToRelation
Representation of the one-to-one relation.
- ICanBoogie\ActiveRecord\Relation uses ICanBoogie\Accessor\AccessorTrait (not available)
- ┗ ICanBoogie\ActiveRecord\BelongsToRelation
Methods summary
public
__construct( ICanBoogie\ActiveRecord\Model
$parent
, ICanBoogie\ActiveRecord\Model
|string $related
, array $options
= [] )
public
__invoke( ICanBoogie\ActiveRecord
$record
)
: ICanBoogie\ActiveRecord\Query
Create a query with the relation.
protected
alter_prototype( ICanBoogie\Prototype $prototype
, string $property
)
Add a getter for the relation to the prototype.
protected
resolve_property_name( ICanBoogie\ActiveRecord\Model
|string $related
)
: string
Resolve the property name from the related model.
Methods inherited from ICanBoogie\ActiveRecord\Relation
get_as()
,
get_foreign_key()
,
get_local_key()
,
get_parent()
,
get_related()
,
resolve_activerecord_class()
,
resolve_related()
Properties summary
Properties inherited from ICanBoogie\ActiveRecord\Relation
$as
,
$foreign_key
,
$local_key
,
$parent
,
$related