PHP Class Pheasant\Finder\Wizard

Show file Open project: lox/pheasant Class Usage Examples

Public Methods

Method Description
__construct ( $schema, $finder ) Construct
dispatch ( $method, $params ) : mixed Magically derives a query to send to the internal finder
find ( $criteria = null ) : Collection Delegates directory to the Finder::find method
fromClass ( $className ) : Wizard Helper to build Wizard

Private Methods

Method Description
_findById ( $params ) Find an object by primary key
_sqlFromMethod ( $method ) Derives an sql clause from a finder method e.g findByLlamaAndBlargh becomes llama=? and blargh=?

Method Details

__construct() public method

Construct
public __construct ( $schema, $finder )

dispatch() public method

Magically derives a query to send to the internal finder
public dispatch ( $method, $params ) : mixed
return mixed Either a Collection or a DomainObject

find() public method

Delegates directory to the Finder::find method
public find ( $criteria = null ) : Collection
return Collection

fromClass() public static method

Helper to build Wizard
public static fromClass ( $className ) : Wizard
return Wizard