PHP 클래스 Pheasant\Relationship

파일 보기 프로젝트 열기: lox/pheasant 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$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