Documentation

HasOne extends AbstractRelationship
in package

Relationship class for "has one" relationships

Tags
category

Pop

author

Nick Sagona, III dev@nolainteractive.com

copyright

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

license

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

version
5.3.0

Table of Contents

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

Properties

Methods

__construct()

Constructor

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

Instantiate the relationship object

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

getChild()

Get child

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

getChildRelationships()

Get child relationships

public getChildRelationships() : string
Return values
string

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
Return values
string

getForeignTable()

Get foreign table class

public getForeignTable() : string
Return values
string

getOptions()

Get options

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

setChildRelationships()

Set children child relationships

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

Search results