Bolt\Storage\Repository\ContentRepository::createQueryBuilder PHP Метод

createQueryBuilder() публичный Метод

public createQueryBuilder ( $alias = 'content' )
    public function createQueryBuilder($alias = 'content')
    {
        return parent::createQueryBuilder($alias);
    }

Usage Example

Пример #1
0
 /**
  * Set the QueryBuilder where parameters.
  *
  * @param ContentRepository $contentRepo
  * @param string            $type
  *
  * @throws \Exception
  *
  * @return Content[]|false
  */
 private function getTimedRecords(ContentRepository $contentRepo, $type)
 {
     /** @var QueryBuilder $query */
     $query = $contentRepo->createQueryBuilder('t')->select('t.id')->andWhere('t.status = :status')->setParameter('currenttime', Carbon::now(), Type::DATETIME);
     if ($type === 'publish') {
         $this->getTimedQuery($query);
     } elseif ($type === 'hold') {
         $this->getPublishedQuery($query);
     } else {
         throw new StorageException(sprintf('Invalid type "%s" for timed record processing.', $type));
     }
     return $contentRepo->findWith($query) ?: [];
 }