public function findOneById($id)
    {
        $id = $this->idToMongo($id);

        if ($this->identityMap->has($id)) {
            return $this->identityMap->get($id);
        }

        return $this->createQuery(array('_id' => $id))->one();
    }
public function findOneById($id)
    {
        $id = $this->idToMongo($id);

        if ($this->identityMap->has($id)) {
            return $this->identityMap->get($id);
        }

        return $this->createQuery(array('_id' => $id))->one();
    }
public function findOneById ( $ id ) { $ id = $ this -> idToMongo ( $ id ) ; if ( $ this -> identityMap -> has ( $ id ) ) { return $ this -> identityMap -> get ( $ id ) ; } return $ this -> createQuery ( array ( '_id' => $ id ) ) -> one ( ) ; }
Returns one document by id.

@param mixed $id An id.

@return \Mandango\Document\Document|null The document or null if it does not exist.

@api
Returns one document by id .