Skip to content

LoggedAt Criterion

The LoggedAtCriterion Activity Log Criterion matches activity log group that has a log entry created before or after a given date time.

Arguments

  • dateTime - a DateTimeInterface object, like DateTime
  • comparison - string that represents a comparison sign. Available signs can be found as constant in the LoggedAtCriterion class itself
Comparison Value Constant
Equal = LoggedAtCriterion::EQ
Not equal <> LoggedAtCriterion::NEQ
Less than < LoggedAtCriterion::LT
Less than or equal <= LoggedAtCriterion::LTE
Greater than > LoggedAtCriterion::GT
Greater than or equal >= LoggedAtCriterion::GTE

Example

The following example is to match all activity log groups that are not older than a day:

1
2
3
$query = new ActivityLog\Query([
    new ActivityLog\Criterion\LoggedAtCriterion(new \DateTime('- 1 day'), ActivityLog\Criterion\LoggedAtCriterion::GTE),
]);