\Pop\Db\Record\RelationshipsBelongsTo

Relationship class for "belongs to" relationships

Summary

Methods
Properties
Constants
__construct()
getForeignTable()
getForeignKey()
getEagerRelationships()
getChild()
getParent()
No public properties found
No constants found
No protected methods found
$foreignTable
$foreignKey
$child
N/A
No private methods found
No private properties found
N/A

Properties

$foreignTable

$foreignTable : string

Foreign table class

Type

string

$foreignKey

$foreignKey : string

Foreign key

Type

string

Methods

__construct()

__construct(\Pop\Db\Record  $child, string  $foreignTable, string  $foreignKey) 

Constructor

Instantiate the relationship object

Parameters

\Pop\Db\Record $child
string $foreignTable
string $foreignKey

getForeignTable()

getForeignTable() : string

Get foreign table class

Returns

string

getForeignKey()

getForeignKey() : string

Get foreign key

Returns

string

getEagerRelationships()

getEagerRelationships(array  $ids) : array

Get eager relationships

Parameters

array $ids

Throws

\Pop\Db\Record\Relationships\Exception

Returns

array

getChild()

getChild() : \Pop\Db\Record

Get child record

Returns

\Pop\Db\Record

getParent()

getParent(array  $options = null) : \Pop\Db\Record

Get parent

Parameters

array $options

Returns

\Pop\Db\Record