public function search($q)
    {
        /* @var \Doctrine\ODM\MongoDB\Query\Builder $qb */
        $qb = $this->repository->createQueryBuilder();
        $qb->field('title')->equals(new \MongoRegex('/' . addslashes($q) . '/i'));
        $cursor = $qb->getQuery()->execute();

        $adapter = new DoctrineMongoCursor($cursor);
        parent::__construct($adapter);

        return $this;
    }
public function search($q)
    {
        /* @var \Doctrine\ODM\MongoDB\Query\Builder $qb */
        $qb = $this->repository->createQueryBuilder();
        $qb->field('title')->equals(new \MongoRegex('/' . addslashes($q) . '/i'));
        $cursor = $qb->getQuery()->execute();

        $adapter = new DoctrineMongoCursor($cursor);
        parent::__construct($adapter);

        return $this;
    }
public function search ( $ q ) { /* @var \Doctrine\ODM\MongoDB\Query\Builder $qb */ $ qb = $ this -> repository -> createQueryBuilder ( ) ; $ qb -> field ( 'title' ) -> equals ( new \ MongoRegex ( '/' . addslashes ( $ q ) . '/i' ) ) ; $ cursor = $ qb -> getQuery ( ) -> execute ( ) ; $ adapter = new DoctrineMongoCursor ( $ cursor ) ; parent :: __construct ( $ adapter ) ; return $ this ; }
Set the search criteria.

@param string $q

@return self
Set the search criteria .