PHP Trait Crud\Traits\FindMethodTrait

Datei anzeigen Open project: friendsofcake/crud

Public Methods

Method Description
findMethod ( string | null $method = null ) : string Change the find() method

Protected Methods

Method Description
_findRecord ( string $id, Crud\Event\Subject $subject ) : Cake\ORM\Entity Find a record from the ID
_notFound ( string $id, Crud\Event\Subject $subject ) : void Throw exception if a record is not found

Method Details

_findRecord() protected method

Find a record from the ID
protected _findRecord ( string $id, Crud\Event\Subject $subject ) : Cake\ORM\Entity
$id string Record id
$subject Crud\Event\Subject Event subject
return Cake\ORM\Entity

_notFound() protected method

Throw exception if a record is not found
protected _notFound ( string $id, Crud\Event\Subject $subject ) : void
$id string Record id
$subject Crud\Event\Subject Event subject
return void

findMethod() public method

If $method is NULL the current value is returned else the findMethod is changed
public findMethod ( string | null $method = null ) : string
$method string | null Method name
return string