Doctrine\ODM\MongoDB\DocumentRepository::createQueryBuilder PHP Method

createQueryBuilder() public method

Creates a new Query\Builder instance that is preconfigured for this document name.
public createQueryBuilder ( ) : Builder
return Doctrine\ODM\MongoDB\Query\Builder $qb
    public function createQueryBuilder()
    {
        return $this->dm->createQueryBuilder($this->documentName);
    }

Usage Example

 public function findVisible($owner)
 {
     if (!$owner instanceof UserInterface) {
         return array();
     }
     $qb = $this->repo->createQueryBuilder()->field('owner.$id')->equals(new \MongoId($owner->getId()))->field('visibility')->equals(CalendarInterface::VISIBILITY_PUBLIC);
     return $qb->getQuery()->execute();
 }
All Usage Examples Of Doctrine\ODM\MongoDB\DocumentRepository::createQueryBuilder