src/Norm/Collection.php
public function find($criteria = array())
    {
        if (!is_array($criteria)) {
            $criteria = array(
                '$id' => $criteria,
            );
        }

        // wrap criteria as NObject instance to make sure it can be override by hooks
        $criteria = new NObject($criteria);

        $this->applyHook('searching', $criteria);
        $cursor = $this->connection->query($this, $criteria->toArray());
        $this->applyHook('searched', $cursor);

        return $cursor;
    }
public function find($criteria = array())
    {
        if (!is_array($criteria)) {
            $criteria = array(
                '$id' => $criteria,
            );
        }

        // wrap criteria as NObject instance to make sure it can be override by hooks
        $criteria = new NObject($criteria);

        $this->applyHook('searching', $criteria);
        $cursor = $this->connection->query($this, $criteria->toArray());
        $this->applyHook('searched', $cursor);

        return $cursor;
    }
public function find ( $ criteria = array ( ) ) { if ( ! is_array ( $ criteria ) ) { $ criteria = array ( '$id' => $ criteria , ) ; } // wrap criteria as NObject instance to make sure it can be override by hooks $ criteria = new NObject ( $ criteria ) ; $ this -> applyHook ( 'searching' , $ criteria ) ; $ cursor = $ this -> connection -> query ( $ this , $ criteria -> toArray ( ) ) ; $ this -> applyHook ( 'searched' , $ cursor ) ; return $ cursor ; }
Find data with specified criteria

@param array $criteria

@return Norm\Cursor
Find data with specified criteria