PHP Class Pheasant\Schema

Mostra file Open project: lox/pheasant

Public Methods

Method Description
__construct ( $class, $params = [] ) Constructor
alias ( ) : string A short alias for the object, used in queries
className ( ) : string The name of the domain objectclass
defaults ( ) : array Returns an array with properties with default values
diff ( $o1, $o2 ) Returns the keys that differ from the second object to the first by their types
equals ( $o1, $o2 ) Check if two objects have equal values as determined by their types
events ( ) : Events Return the schema-wide {@link Events} object
getter ( $attr ) : closure Return a closure for getting an attribute from a domain object
hasAttribute ( $attr ) Check if attribute is available on a domain object
hash ( $object, $keys ) Returns a hash in the form Class[key=val]
hydrate ( $row ) : object Hydrates a database array into the domain object of the schema
identity ( $object ) : Identity Returns an identity for a domain object
marshal ( $row ) : array Converts an array using each columns type object to database format
newInstance ( $args = [] ) : object Creates an instance of the object, passes args to the constructor
primary ( ) : array Returns an array of Properties that form the primary keys
properties ( ) : array Returns the Property objects for the schema
relationship ( $name ) : Relationship Returns a particular Relationship
relationships ( ) : array Returns the Relationship objects for the schema
setter ( $attr ) : closure Return a closure for setting an attribute on a domain object
unmarshal ( $row ) : array Converts an array using each columns type object to the object format

Method Details

__construct() public method

Constructor
public __construct ( $class, $params = [] )

alias() public method

A short alias for the object, used in queries
public alias ( ) : string
return string

className() public method

The name of the domain objectclass
public className ( ) : string
return string

defaults() public method

Returns an array with properties with default values
public defaults ( ) : array
return array

diff() public method

Returns the keys that differ from the second object to the first by their types
public diff ( $o1, $o2 )

equals() public method

Check if two objects have equal values as determined by their types
public equals ( $o1, $o2 )

events() public method

Return the schema-wide {@link Events} object
public events ( ) : Events
return Events

getter() public method

Return a closure for getting an attribute from a domain object
public getter ( $attr ) : closure
return closure

hasAttribute() public method

Check if attribute is available on a domain object
public hasAttribute ( $attr )

hash() public method

Returns a hash in the form Class[key=val]
public hash ( $object, $keys )

hydrate() public method

Hydrates a database array into the domain object of the schema
public hydrate ( $row ) : object
return object

identity() public method

Returns an identity for a domain object
public identity ( $object ) : Identity
return Identity

marshal() public method

Converts an array using each columns type object to database format
public marshal ( $row ) : array
return array

newInstance() public method

Creates an instance of the object, passes args to the constructor
public newInstance ( $args = [] ) : object
return object

primary() public method

Returns an array of Properties that form the primary keys
public primary ( ) : array
return array

properties() public method

Returns the Property objects for the schema
public properties ( ) : array
return array

relationship() public method

Returns a particular Relationship
public relationship ( $name ) : Relationship
return Relationship

relationships() public method

Returns the Relationship objects for the schema
public relationships ( ) : array
return array

setter() public method

Return a closure for setting an attribute on a domain object
public setter ( $attr ) : closure
return closure

unmarshal() public method

Converts an array using each columns type object to the object format
public unmarshal ( $row ) : array
return array