Flarum\Core\Search\AbstractSearch::getQuery PHP Method

getQuery() public method

Get the query builder for the search results query.
public getQuery ( ) : Builder
return Illuminate\Database\Query\Builder
    public function getQuery()
    {
        return $this->query;
    }

Usage Example

Esempio n. 1
0
 /**
  * {@inheritdoc}
  */
 protected function conditions(AbstractSearch $search, array $matches, $negate)
 {
     if (!$search instanceof DiscussionSearch) {
         throw new LogicException('This gambit can only be applied on a DiscussionSearch');
     }
     // If we've just been provided with a single YYYY-MM-DD date, then find
     // discussions that were started on that exact date. But if we've been
     // provided with a YYYY-MM-DD..YYYY-MM-DD range, then find discussions
     // that were started during that period.
     if (empty($matches[3])) {
         $search->getQuery()->whereDate('start_time', $negate ? '!=' : '=', $matches[1]);
     } else {
         $search->getQuery()->whereBetween('start_time', [$matches[1], $matches[3]], 'and', $negate);
     }
 }
All Usage Examples Of Flarum\Core\Search\AbstractSearch::getQuery