@param QueryDate $date

@return UrlQueryBuilder
432151
public function setDate($date)
    {
        $this->add(self::PERIOD, $date->getPeriod());
        $this->add(self::DATE, $date->getDate());

        return $this;
    }
121689
public function hasStatementForDate($date)
    {
        if (is_string($date)) {
            $date = new \DateTime($date);
        }

        return null !== $this->getStatementForDate($date);
    }
129906
public function max($date = null)
    {
        $date = $this->resolveCarbon($date);

        return $this->gt($date) ? $this : $date;
    }
390478
public function createQuery($params, $queryBuilder)
    {
        $userID = $this->auth->getUser()->getId();
        if ($params instanceof Parameters) {
            $value = $params->toArray();
        } else {
            $value = $params;
        }
    
        if (isset($value['job']) && !empty($value['job'])) {
            $queryBuilder->field('job')->equals($value['job']);
        }

        if (isset($value['unread']) && !empty($value['unread'])) {
            $queryBuilder->field('readBy')->notEqual($userID);
        }

        if (isset($value['q']) && !empty($value['q'])) {
            $search = strtolower($value['q']);
            $searchPatterns = array();
    
            foreach (explode(' ', $search) as $searchItem) {
                $searchPatterns[] = new \MongoRegex('/^' . $searchItem . '/');
            }
            $queryBuilder->field('keywords')->all($searchPatterns);
        }
        
        /*
         * We only show applications to which the user has view permissions.
         * and which are not in draft mode
         */
        $queryBuilder->field('permissions.view')->equals($userID)
                     ->field('isDraft')->equals(false);

        if (!isset($value['sort'])) {
            $value['sort'] = '-date';
        }
        
        if (isset($value['status']) && 'all' != $value['status']) {
            $queryBuilder->field('status.name')->equals($value['status']);
        }
        $queryBuilder->sort($this->filterSort($value['sort']));
        
        return $queryBuilder;
    }
217777
public function toSqlDate(DateTimeInterface $date, Provider $provider = null) : string
    {
        $this->setParameterProvider($provider);

        return $date->format($provider->getDateFormat());
    }
1242056
public static function instance($date)
    {
        if ($date instanceof static) {
            return clone $date;
        }

        static::expectDateTime($date);

        $instance = new static($date->format('Y-m-d H:i:s.u'), $date->getTimezone());

        if ($date instanceof CarbonInterface || $date instanceof Options) {
            $instance->settings($date->getSettings());
        }

        return $instance;
    }
1338813
private static function cast(Date $date = null)
	{
		if (!is_null($date))
		{
			$date = new DateTime($date);
		}

		return $date;
	}
1339723
public function useFiltersFromTypoScript(): QueryBuilder
    {
        $filters = Filters::fromTypoScriptConfiguration($this->typoScriptConfiguration);
        $this->queryToBuild->setFilterQueries($filters->getValues());

        $this->useFilterArray($this->getAdditionalFilters());

        $searchQueryFilters = $this->typoScriptConfiguration->getSearchQueryFilterConfiguration();

        if (!is_array($searchQueryFilters) || count($searchQueryFilters) <= 0) {
            return $this;
        }

        // special filter to limit search to specific page tree branches
        if (array_key_exists('__pageSections', $searchQueryFilters)) {
            $pageIds = GeneralUtility::trimExplode(',', $searchQueryFilters['__pageSections']);
            $this->usePageSectionsFromPageIds($pageIds);
            $this->typoScriptConfiguration->removeSearchQueryFilterForPageSections();
        }

        return $this;
    }
520292
public function dateFilter() {

		// Apply the from date filter.

		$request = $this->getRequest();
		$from = $request->getVar('from');
		$link = $this->Link();
		$separator = '?';
		if($from) {

			// Determine the formatted URL to represent the request filter.

			$date = DBDate::create()->setValue($from);
			$link .= $date->Format('y/MM/dd/');
		}

		// Preserve the category/tag filters if they exist.

		$category = $request->getVar('category');
		$tag = $request->getVar('tag');
		if($category) {
			$link = HTTP::setGetVar('category', $category, $link, $separator);
			$separator = '&';
		}
		if($tag) {
			$link = HTTP::setGetVar('tag', $tag, $link, $separator);
		}

		// Allow extension customisation.

		$this->extend('updateFilter', $link);

		// Request the filtered paginated children.

		return $this->redirect($link);
	}
1192924
private function getQuery($siteId, $url = null)
    {
        if (empty($siteId) || !is_numeric($siteId)) {
            throw new InvalidArgumentException('Invalid Site Id To Search By');
        }

        /** @var \Doctrine\ORM\QueryBuilder $queryBuilder */
        $queryBuilder = $this->_em->createQueryBuilder();

        $queryBuilder
            ->select('r')
            ->from(\Rcm\Entity\Redirect::class, 'r', 'r.requestUrl')
            ->leftJoin('r.site', 'site')
            ->where('r.site = :siteId')
            ->orWhere('r.site is null')
            ->orderBy('site.siteId', 'DESC')//Makes site-specific rules take priority
            ->setMaxResults(1)//Improves speed when no match found
            ->setParameter('siteId', $siteId);

        if (!empty($url)) {
            $queryBuilder->andWhere('r.requestUrl = :requestUrl');
            $queryBuilder->setParameter('requestUrl', $url);
        }

        return $queryBuilder->getQuery();
    }
1308739
public function findByDate(\DateTime $date = null)
    {
        $qb = $this->createQueryBuilder('p')
            ->where('p.date LIKE :date')
            ->addOrderBy('p.date', 'DESC')
            ->addOrderBy('p.id', 'DESC')
            ->setParameter('date', $date->format('Y-m-d').'%');

        return $qb->getQuery()->getResult();
    }
94811
protected function convertToSqlDate($date, $isMax = false)
    {
        if (! $date instanceof \DateTime) {
            return;
        }
        
        $copy = clone $date;

        if ($isMax) {
            $copy->modify('+1 day -1 second');
        }

        return $this->expr()->literal($copy->format(self::SQL_DATE_TIME));
    }
457780
public function setDateTimeFrom($date = null)
    {
        $date = $this->resolveCarbon($date);

        return $this->modify($date->rawFormat('Y-m-d H:i:s.u'));
    }
24214
public function show($date, Request $request)
    {
        $level   = 'all';
        $log     = $this->getLogOrFail($date);
        $query   = $request->get('query');
        $levels  = $this->logViewer->levelsNames();
        $entries = $log->entries($level)->paginate($this->perPage);

        return $this->view('show', compact('level', 'log', 'query', 'levels', 'entries'));
    }
1303430
final public static function cloneDateTime($date)
    {
        try {
            $result = new \DateTimeImmutable();
            return $result->setTimezone($date->getTimezone())->setTimestamp($date->getTimestamp());
        } catch (\Exception $e) {
            return null;
        }
    }
924533
private function dateIsInRequestFrame(\DateTime $date)
    {
        if (null === $date) {
            return false;
        }

        return (new \DateTime())->add(self::getResetInterval()) < $date->add(self::getRequestInterval());
    }
56077
public function createQuery($params, $queryBuilder)
    {
        if (!empty($params['q'])) {
            $queryBuilder->text($params['q']);
        }

        $sort = $this->filterSort($params['sort']);
        $queryBuilder->sort($sort);

        return $queryBuilder;
    }