original_string: 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;
      }
code: 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;
      }
code_tokens: 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 ; }
docstring: Find data with specified criteria
  
  @param array $criteria
  
  @return Norm\Cursor
docstring_tokens: Find data with specified criteria