getResultDataCollection() as $pdr_schedule) { if (null === $this->getClickAndCollect()) { $theDate = PlanificationLivraison::calculateRelativeDate($pdr_schedule->getDay(), null); } else { $newDate = PlanificationLivraison::calculateRelativeDate(null, $this->getPlaceId()); if ($theDate == '' || $newDate < $theDate) $theDate = $newDate; } $loopResultRow = new LoopResultRow($pdr_schedule); $loopResultRow ->set("ID", $pdr_schedule->getId()) ->set("PLACE_ID", $pdr_schedule->getIdPlace()) ->set("DAY", $pdr_schedule->getDay()) ->set("DAY_LABEL", PlanificationLivraison::getDayLabel($pdr_schedule->getDay())) ->set("BEGIN", $pdr_schedule->getBeginTime()) ->set("END", $pdr_schedule->getEndTime()) ->set("CALCULATED_DAY", PlanificationLivraison::getDayLabel(($theDate->format('w') - 1) % 6) . ' ' . $theDate->format(PlanificationLivraison::FORMAT_DATES)) ; $loopResult->addRow($loopResultRow); } return $loopResult; } /** * @inheritdoc */ protected function getArgDefinitions() { return new ArgumentCollection( Argument::createIntListTypeArgument('id'), Argument::createIntListTypeArgument('place_id'), Argument::createBooleanTypeArgument('click_and_collect', null) ); } /** * @inheritdoc */ public function buildModelCriteria() { $places = PdrScheduleQuery::create(); if (null != $id = $this->getId()) { $places->filterById($id); } if (null != $id = $this->getPlaceId()) { $places->filterByIdPlace($id); } return $places->orderByDay()->orderByBeginTime(); } }