src/db/orm/Worker.php
public function find($query, $allowMany = false) {  // TODO: numRows() is not available on SQLite or with PDO and the
        $result = $this->query($query);                 //       emulation is slow. The check can be improved with fetchRow()
                                                        //       when reset(-1) and internal record caching are implemented.
        $object = $this->makeObject($result);           //
        if ($object && !$allowMany && $result->numRows() > 1) throw new MultipleRecordsException($query);

        return $object;
    }
public function find($query, $allowMany = false) {  // TODO: numRows() is not available on SQLite or with PDO and the
        $result = $this->query($query);                 //       emulation is slow. The check can be improved with fetchRow()
                                                        //       when reset(-1) and internal record caching are implemented.
        $object = $this->makeObject($result);           //
        if ($object && !$allowMany && $result->numRows() > 1) throw new MultipleRecordsException($query);

        return $object;
    }
public function find ( $ query , $ allowMany = false ) { // TODO: numRows() is not available on SQLite or with PDO and the $ result = $ this -> query ( $ query ) ; //       emulation is slow. The check can be improved with fetchRow() //       when reset(-1) and internal record caching are implemented. $ object = $ this -> makeObject ( $ result ) ; // if ( $ object && ! $ allowMany && $ result -> numRows ( ) > 1 ) throw new MultipleRecordsException ( $ query ) ; return $ object ; }
Find a single matching record and convert it to an instance of the entity class.

@param  string $query                - SQL query with optional ORM syntax
@param  bool   $allowMany [optional] - whether the query is allowed to return a multi-row result (default: no)

@return PersistableObject|null

@throws MultipleRecordsException if the query returned multiple rows and $allowMany was not set to TRUE.
Find a single matching record and convert it to an instance of the entity class .