Skip to content

Latest commit

 

History

History
25 lines (19 loc) · 435 Bytes

HavingFilter.md

File metadata and controls

25 lines (19 loc) · 435 Bytes

HavingFilter

This filter accepts objects if they have an expected status.

For example:

class MyObject
{
    private $paths = [];

    public function hasRoot()
    {
        return $this->hasPath('/');
    }
    
    public function hasPath($path)
    {
        return array_search($path, $this->paths) !== false;
    }
}

$objects = $funnel->findByHaving('root');
$objects = $funnel->findByHaving('path', '/my/path');