Copied!

EventQueryBuilder

EventQueryBuilder.php : 27

Allows to build event query in a fluent way.

The following example query is searching for events occurring in 2020, and typed 'scheduled_publication':

$query = (new EventQueryBuilder())
 ->withDateRange(new DateRange(new DateTime('2020-01-01'), new DateTime('2021-01-01')))
 ->withTypes(['scheduled_publication'])
 ->getQuery();

Methods

public__construct()

EventQueryBuilder.php : 44
public __construct()

publicfromQuery()

EventQueryBuilder.php : 110
public static fromQuery(EventQuery $query) : self

Parameters

Name Type Default value Description
$query EventQuery - -

Return values

self

publicgetQuery()

EventQueryBuilder.php : 95

Builds the query.

public getQuery() : EventQuery

Return values

EventQuery

Tags
Throws
LogicException

if date range is not specified

publicwithCount()

EventQueryBuilder.php : 49
public withCount(int $count) : self

Parameters

Name Type Default value Description
$count int - -

Return values

self

publicwithCursor()

EventQueryBuilder.php : 63
public withCursor(Cursor|null $cursor) : self

Parameters

Name Type Default value Description
$cursor Cursor|null - -

Return values

self

publicwithDateRange()

EventQueryBuilder.php : 56
public withDateRange(DateRange $dateRange) : self

Parameters

Name Type Default value Description
$dateRange DateRange - -

Return values

self

publicwithLanguages()

EventQueryBuilder.php : 83
public withLanguages(array<string|int, Language>|null $languages) : self

Parameters

Name Type Default value Description
$languages array<string|int, Language>|null - -

Return values

self

publicwithTypes()

EventQueryBuilder.php : 73
public withTypes(array<string|int, string>|null $types) : self

Parameters

Name Type Default value Description
$types array<string|int, string>|null - -

Return values

self