/** * @param Driver $driver * @return DriverListDTO */ public function driverToDriverListDTO(Driver $driver) { $driverListDTO = new DriverListDTO(); $driverListDTO->id = $driver->getId(); $driverListDTO->gender = $driver->getGenderAsString(); $driverListDTO->firstname = $driver->getFirstname(); $driverListDTO->telephone = $driver->getTelephone(); $driverListDTO->lastname = $driver->getLastname(); $driverListDTO->street = $driver->getAddress()->getStreet(); $driverListDTO->city = $driver->getAddress()->getCity(); $driverListDTO->driverCategory = $driver->getDriverCategory()->getName(); $driverListDTO->wheelChairAttendance = $driver->getWheelChairAttendanceAsString(); return $driverListDTO; }
/** * @param Driver $driver * @return bool */ public function isDriverAssociatedToThisShift(Driver $driver) { foreach ($this->getDrivingPools() as $drivingPool) { $poolDriver = $drivingPool->getDriver(); if ($poolDriver !== null) { if ($poolDriver->getId() === $driver->getId()) { return true; } } } return false; }
private function driverRemove(Driver $driver) { $id = $driver->getId(); Driver::removeDriver($driver); $this->init->em->remove($driver); $this->init->em->flush(); $this->assertEquals(null, $this->init->driverRepo->find($id)); }