PHP Класс Pheasant\Relationship

Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$class
$foreign
$local

Открытые методы

Метод Описание
__construct ( $class, $local, $foreign = null )
add ( $object, $value )
addJoin ( $query, $parentAlias, $schema, $relName, $nested = [], $joinType = 'inner' ) : void Adds a join clause to the given query for the given schema and relationship. Optionally takes a nested list of relationships that will be recursively joined as needed.
get ( $object, $key )
getter ( $key, $cache = null ) delegate double dispatch calls to type
normalizeMap ( $array ) : array Takes either a flat array of relationships or a nested key=>value array and returns it as a nested format
parseRelName ( $relName ) : array Parses RelName r1 as array('RelName', 'r1') or Relname as array('RelName','RelName')
set ( $object, $key, $value )
setter ( $key )

Защищенные методы

Метод Описание
adder ( $object ) : Closure Helper function that creates a closure that calls the add function
hydrate ( $row ) : DomainObject Delegates to the schema for hydrating
query ( $sql, $params ) : Query Delegates to the finder for querying

Описание методов

__construct() публичный Метод

public __construct ( $class, $local, $foreign = null )

add() публичный Метод

public add ( $object, $value )

addJoin() публичный статический Метод

Adds a join clause to the given query for the given schema and relationship. Optionally takes a nested list of relationships that will be recursively joined as needed.
public static addJoin ( $query, $parentAlias, $schema, $relName, $nested = [], $joinType = 'inner' ) : void
Результат void

adder() защищенный Метод

Helper function that creates a closure that calls the add function
protected adder ( $object ) : Closure
Результат Closure

get() публичный Метод

public get ( $object, $key )

getter() публичный Метод

delegate double dispatch calls to type
public getter ( $key, $cache = null )

hydrate() защищенный Метод

Delegates to the schema for hydrating
protected hydrate ( $row ) : DomainObject
Результат DomainObject

normalizeMap() публичный статический Метод

Takes either a flat array of relationships or a nested key=>value array and returns it as a nested format
public static normalizeMap ( $array ) : array
Результат array

parseRelName() публичный статический Метод

Parses RelName r1 as array('RelName', 'r1') or Relname as array('RelName','RelName')
public static parseRelName ( $relName ) : array
Результат array

query() защищенный Метод

Delegates to the finder for querying
protected query ( $sql, $params ) : Query
Результат Query

set() публичный Метод

public set ( $object, $key, $value )

setter() публичный Метод

public setter ( $key )

Описание свойств

$class публичное свойство

public $class

$foreign публичное свойство

public $foreign

$local публичное свойство

public $local