Maslosoft Mangan API
Interface WithCriteriaInterface
Use this interface to associate Criteria with model. This could be used together with DataProvider, or finders with custom methods setting criteria.
Example usage. Define published
method:
public function published() { $this->getDbCriteria()->published = true; return $this; }
Then this could be used with dataprovider:
new DataProvider((new Page)->published());
NOTE: It is recommended to use CriteriaAwareInterface
Direct known implementers
Indirect known implementers
Maslosoft\Mangan\Document
,
Maslosoft\Mangan\Example\ExampleUser
,
Maslosoft\Mangan\Model\Trash
,
Maslosoft\Mangan\Model\TrashItem
See:
Maslosoft\Mangan\Interfaces\CriteriaInterface
Author: Piotr Maselkowski
Located at Interfaces/WithCriteriaInterface.php
Methods summary
public
|
#
getDbCriteria( boolean $createIfNull = true )
Returns the mongo criteria associated with this model. |
public
|
#
setDbCriteria(
Set current object, this will override previous criteria |