/** * Sets the topEvent constraint to the given constraints array * * @param \TYPO3\CMS\Extbase\Persistence\QueryInterface $query Query * @param \DERHANSEN\SfEventMgt\Domain\Model\Dto\EventDemand $eventDemand EventDemand * @param array $constraints Constraints * * @return void */ protected function setTopEventConstraint($query, $eventDemand, &$constraints) { if ($eventDemand->getTopEventRestriction() > 0) { $constraints[] = $query->equals('topEvent', (bool) ($eventDemand->getTopEventRestriction() - 1)); } }
/** * @test */ public function setTopEventRestrictionForIntegerSetsTopEventRestriction() { $this->subject->setTopEventRestriction(1); $this->assertSame(1, $this->subject->getTopEventRestriction()); }