/** * @param ShiftType $shiftType * @return ShiftTypeListDTO */ public function shiftTypesToShiftTypeListDTO(ShiftType $shiftType) { $shiftTypeEmbeddedListDTO = new ShiftTypeListDTO(); $shiftTypeEmbeddedListDTO->id = $shiftType->getId(); $shiftTypeEmbeddedListDTO->name = $shiftType->getName(); $shiftTypeEmbeddedListDTO->start = $this->dateTimeService->convertToLocalTimeString($shiftType->getStart()); $shiftTypeEmbeddedListDTO->end = $this->dateTimeService->convertToLocalTimeString($shiftType->getEnd()); return $shiftTypeEmbeddedListDTO; }
/** * @param ShiftType $match * @return bool */ protected function matchShiftType(ShiftType $match) { foreach ($this->getShiftTypes() as $shiftType) { if ($shiftType->getId() == $match->getId()) { return true; } } return false; }