library/Drakojn/Io/Driver/Stream.php
public function find(Mapper $mapper, array $query = [])
    {
        $map        = $mapper->getMap();
        $pathMap    = $this->buildUri($map->getRemoteName());
        $pathHandle = opendir($pathMap);
        $objects    = [];
        while (false !== ($file = readdir($pathHandle))) {
            $objects[] = $this->read($map, $file);
        }
        closedir($pathHandle);
        $objects = array_filter($objects);
        $objects = array_filter(
            $objects,
            function ($object) use ($map, $query) {
                $data   = $map->getData($object);
                $result = 1;
                foreach ($data as $property => $value) {
                    $result -= (isset($query[$property]) && $query[$property] != $value);
                }
                return (bool)$result;
            }
        );
        return array_values($objects);
    }
public function find(Mapper $mapper, array $query = [])
    {
        $map        = $mapper->getMap();
        $pathMap    = $this->buildUri($map->getRemoteName());
        $pathHandle = opendir($pathMap);
        $objects    = [];
        while (false !== ($file = readdir($pathHandle))) {
            $objects[] = $this->read($map, $file);
        }
        closedir($pathHandle);
        $objects = array_filter($objects);
        $objects = array_filter(
            $objects,
            function ($object) use ($map, $query) {
                $data   = $map->getData($object);
                $result = 1;
                foreach ($data as $property => $value) {
                    $result -= (isset($query[$property]) && $query[$property] != $value);
                }
                return (bool)$result;
            }
        );
        return array_values($objects);
    }
public function find ( Mapper $ mapper , array $ query = [ ] ) { $ map = $ mapper -> getMap ( ) ; $ pathMap = $ this -> buildUri ( $ map -> getRemoteName ( ) ) ; $ pathHandle = opendir ( $ pathMap ) ; $ objects = [ ] ; while ( false !== ( $ file = readdir ( $ pathHandle ) ) ) { $ objects [ ] = $ this -> read ( $ map , $ file ) ; } closedir ( $ pathHandle ) ; $ objects = array_filter ( $ objects ) ; $ objects = array_filter ( $ objects , function ( $ object ) use ( $ map , $ query ) { $ data = $ map -> getData ( $ object ) ; $ result = 1 ; foreach ( $ data as $ property => $ value ) { $ result -= ( isset ( $ query [ $ property ] ) && $ query [ $ property ] != $ value ) ; } return ( bool ) $ result ; } ) ; return array_values ( $ objects ) ; }
@param Mapper $mapper
@param array  $query

@return array
@param Mapper $mapper @param array $query