\Pop\Db\Record\RelationshipsHasMany

Relationship class for "has many" relationships

Summary

Methods
Properties
Constants
__construct()
getForeignTable()
getForeignKey()
getEagerRelationships()
getParent()
getChildren()
No public properties found
No constants found
No protected methods found
$foreignTable
$foreignKey
$parent
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

$parent

$parent : \Pop\Db\Record

Parent record

Type

\Pop\Db\Record

Methods

__construct()

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

Constructor

Instantiate the relationship object

Parameters

\Pop\Db\Record $parent
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, boolean  $asArray = false) : array

Get eager relationships

Parameters

array $ids
boolean $asArray

Throws

\Pop\Db\Record\Relationships\Exception

Returns

array

getParent()

getParent() : \Pop\Db\Record

Get parent record

Returns

\Pop\Db\Record

getChildren()

getChildren(array  $options = null) : \Pop\Db\Record\Relationships\Collection

Get children

Parameters

array $options

Returns

\Pop\Db\Record\Relationships\Collection