ActiveWindowBehavior
extends Behavior
in package
ActiveWindow Behavior
Temporal filtering for entities with start_on/expires_on date windows. Provides findUpcoming, findCurrent, and findPrevious finders.
Tags
Table of Contents
Methods
- findCurrent() : SelectQuery
- Find records currently active (started and not expired).
- findPrevious() : SelectQuery
- Find records that have expired (expires_on < effective date).
- findUpcoming() : SelectQuery
- Find records starting in the future or not yet expired.
Methods
findCurrent()
Find records currently active (started and not expired).
public
findCurrent(SelectQuery $query[, Datetime|null $effectiveDate = null ]) : SelectQuery
Parameters
- $query : SelectQuery
-
The query to modify
- $effectiveDate : Datetime|null = null
-
Date to check against (defaults to now)
Return values
SelectQuery —Modified query with current active conditions
findPrevious()
Find records that have expired (expires_on < effective date).
public
findPrevious(SelectQuery $query[, Datetime|null $effectiveDate = null ]) : SelectQuery
Parameters
- $query : SelectQuery
-
The query to modify
- $effectiveDate : Datetime|null = null
-
Date to check against (defaults to now)
Return values
SelectQuery —Modified query with expired conditions
findUpcoming()
Find records starting in the future or not yet expired.
public
findUpcoming(SelectQuery $query[, Datetime|null $effectiveDate = null ]) : SelectQuery
Parameters
- $query : SelectQuery
-
The query to modify
- $effectiveDate : Datetime|null = null
-
Date to check against (defaults to now)
Return values
SelectQuery —Modified query with upcoming conditions