Class Relation
Representation of a relation.
-
ICanBoogie\ActiveRecord\Relation
uses
ICanBoogie\Accessor\AccessorTrait (not available)
Methods summary
protected
get_parent( void )
protected
get_local_key( void )
protected
get_foreign_key( void )
protected
alter_prototype( ICanBoogie\Prototype $prototype
, string $property
)
Add a getter for the relation to the prototype.
Add a getter for the relation to the prototype.
Parameters
$prototype
- The active record prototype.
$property
- The name of the property.
protected
resolve_activerecord_class( ICanBoogie\ActiveRecord\Model
$model
)
: string
Resolve the active record class name from the specified model.
Resolve the active record class name from the specified model.
Parameters
Returns
string
Throws
protected
resolve_property_name( ICanBoogie\ActiveRecord\Model
|string $related
)
: string
Resolve the property name from the related model.
Resolve the property name from the related model.
Parameters
$related
- The related model of the relation.
Returns
string
Properties summary
protected
$as
: string
The name of the relation.
The name of the relation.
protected
$local_key
: string
Local key. Default: The parent model's primary key.
Local key. Default: The parent model's primary key.
protected
$foreign_key
: string
Foreign key. Default: The parent model's primary key.
Foreign key. Default: The parent model's primary key.
Magic properties
public read-only
$as
: string
The name of the relation.
public read-only
$local_key
: string
public read-only
$foreign_key
: string