PHP Class Pheasant\Relationship

Afficher le fichier Open project: lox/pheasant Class Usage Examples

Méthodes publiques

Свойство Type Description
$class
$foreign
$local

Méthodes publiques

Méthode Description
__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 )

Méthodes protégées

Méthode Description
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

Method Details

__construct() public méthode

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

add() public méthode

public add ( $object, $value )

addJoin() public static méthode

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
Résultat void

adder() protected méthode

Helper function that creates a closure that calls the add function
protected adder ( $object ) : Closure
Résultat Closure

get() public méthode

public get ( $object, $key )

getter() public méthode

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

hydrate() protected méthode

Delegates to the schema for hydrating
protected hydrate ( $row ) : DomainObject
Résultat DomainObject

normalizeMap() public static méthode

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
Résultat array

parseRelName() public static méthode

Parses RelName r1 as array('RelName', 'r1') or Relname as array('RelName','RelName')
public static parseRelName ( $relName ) : array
Résultat array

query() protected méthode

Delegates to the finder for querying
protected query ( $sql, $params ) : Query
Résultat Query

set() public méthode

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

setter() public méthode

public setter ( $key )

Property Details

$class public_oe property

public $class

$foreign public_oe property

public $foreign

$local public_oe property

public $local