Documentation

BelongsTo extends AbstractRelationship
in package

Relationship class for "belongs to" relationships

Tags
category

Pop

author

Nick Sagona, III dev@nolainteractive.com

copyright

Copyright (c) 2009-2024 NOLA Interactive, LLC. (http://www.nolainteractive.com)

license

http://www.popphp.org/license New BSD License

version
6.5.0

Table of Contents

Properties

$child  : Record|null
Child record
$children  : string|null
Relationship children
$foreignKey  : string|null
Foreign key
$foreignTable  : string|null
Foreign table class
$options  : array<string|int, mixed>|null
Relationship options

Methods

__construct()  : mixed
Constructor
getChild()  : Record|null
Get child record
getChildRelationships()  : string|null
Get child relationships
getEagerRelationships()  : array<string|int, mixed>
Get eager relationships
getForeignKey()  : string|null
Get foreign key
getForeignTable()  : string|null
Get foreign table class
getOptions()  : array<string|int, mixed>|null
Get options
getParent()  : Record|null
Get parent
setChildRelationships()  : static
Set children child relationships

Properties

Methods

__construct()

Constructor

public __construct(Record $child, string $foreignTable, string $foreignKey[, array<string|int, mixed>|null $options = null ]) : mixed

Instantiate the relationship object

Parameters
$child : Record
$foreignTable : string
$foreignKey : string
$options : array<string|int, mixed>|null = null

getChildRelationships()

Get child relationships

public getChildRelationships() : string|null
Return values
string|null

getEagerRelationships()

Get eager relationships

public getEagerRelationships(array<string|int, mixed> $ids) : array<string|int, mixed>
Parameters
$ids : array<string|int, mixed>
Tags
throws
Exception
Return values
array<string|int, mixed>

getForeignKey()

Get foreign key

public getForeignKey() : string|null
Return values
string|null

getForeignTable()

Get foreign table class

public getForeignTable() : string|null
Return values
string|null

getOptions()

Get options

public getOptions() : array<string|int, mixed>|null
Return values
array<string|int, mixed>|null

getParent()

Get parent

public getParent([array<string|int, mixed>|null $options = null ]) : Record|null
Parameters
$options : array<string|int, mixed>|null = null
Return values
Record|null

setChildRelationships()

Set children child relationships

public setChildRelationships(string $children) : static
Parameters
$children : string
Return values
static

        
On this page

Search results