public function findOneByExample($example)
    {
        $cursor = $this->byExample($this->_collectionName, $example);
        if ($cursor->getCount() > 0) {
            /* @var $document AbstractEntity */
            $document = $cursor->getAll()[0];
            $document->setIsNew(false);

            return $document;
        }

        return false;
    }
public function findOneByExample($example)
    {
        $cursor = $this->byExample($this->_collectionName, $example);
        if ($cursor->getCount() > 0) {
            /* @var $document AbstractEntity */
            $document = $cursor->getAll()[0];
            $document->setIsNew(false);

            return $document;
        }

        return false;
    }
public function findOneByExample ( $ example ) { $ cursor = $ this -> byExample ( $ this -> _collectionName , $ example ) ; if ( $ cursor -> getCount ( ) > 0 ) { /* @var $document AbstractEntity */ $ document = $ cursor -> getAll ( ) [ 0 ] ; $ document -> setIsNew ( false ) ; return $ document ; } return false ; }
Find by Example.

@param array $example

@return AbstractEntity|bool
Find by Example .