public function findOneWhere($criteria, $returnType = Table::RETURN_MODEL) {
        $this->limit(1);
        $result = $this->findWhere($criteria, $returnType);
        if (is_array($result)) {
            $result = array_values($result);
            return ($returnType === Table::RETURN_JSON) ? json_encode($result[0])
                        : $result[0];
        }
        else if (is_object($result)) {
            return $result->first();
        }
    }
public function findOneWhere($criteria, $returnType = Table::RETURN_MODEL) {
        $this->limit(1);
        $result = $this->findWhere($criteria, $returnType);
        if (is_array($result)) {
            $result = array_values($result);
            return ($returnType === Table::RETURN_JSON) ? json_encode($result[0])
                        : $result[0];
        }
        else if (is_object($result)) {
            return $result->first();
        }
    }
public function findOneWhere ( $ criteria , $ returnType = Table :: RETURN_MODEL ) { $ this -> limit ( 1 ) ; $ result = $ this -> findWhere ( $ criteria , $ returnType ) ; if ( is_array ( $ result ) ) { $ result = array_values ( $ result ) ; return ( $ returnType === Table :: RETURN_JSON ) ? json_encode ( $ result [ 0 ] ) : $ result [ 0 ] ; } else if ( is_object ( $ result ) ) { return $ result -> first ( ) ; } }
Finds a row with the given criteria
@param array|Mapper $criteria
@param int $returnType Indicates the type of return expected.
Possible values (Table::RETURN_MODEL | Table::RETURN_JSON | Table::RETURN_DEFAULT)
@return mixed
Finds a row with the given criteria