private function _findById($params)
    {
        if(count($params) > 1)
            throw new \InvalidArgumentException("byId doesn't support composite keys");

        $keys = array_keys($this->_schema->primary());

        return $this->_finder->find($this->_class, new Criteria("`{$keys[0]}`=?", $params[0]))->one();
    }
private function _findById($params)
    {
        if(count($params) > 1)
            throw new \InvalidArgumentException("byId doesn't support composite keys");

        $keys = array_keys($this->_schema->primary());

        return $this->_finder->find($this->_class, new Criteria("`{$keys[0]}`=?", $params[0]))->one();
    }
private function _findById ( $ params ) { if ( count ( $ params ) > 1 ) throw new \ InvalidArgumentException ( "byId doesn't support composite keys" ) ; $ keys = array_keys ( $ this -> _schema -> primary ( ) ) ; return $ this -> _finder -> find ( $ this -> _class , new Criteria ( "`{$keys[0]}`=?" , $ params [ 0 ] ) ) -> one ( ) ; }
Find an object by primary key
Find an object by primary key