public function generateCondition( ConditionInterface
$condition,
QueryBuilder
$query,
ShopContextInterface
$context ) { $this->
addCondition($condition,
$query);
} private function addCondition(ReleaseDateCondition
$condition, QueryBuilder
$query): void
{ $date =
new DateTime();
$intervalSpec = 'P' .
$condition->
getDays() . 'D';
$interval =
new DateInterval($intervalSpec);
$dateNow =
new DateTime();
$min = ':releaseDateFrom' .
md5(json_encode($condition, JSON_THROW_ON_ERROR
));
$max = ':releaseDateTo' .
md5(json_encode($condition, JSON_THROW_ON_ERROR
));
$now = ':dateNow' .
md5(json_encode($condition, JSON_THROW_ON_ERROR
));
switch ($condition->
getDirection()) { case ReleaseDateCondition::DIRECTION_FUTURE:
$date->
add($interval);