/** ------------------------- * Check if the prospective assertions still match for the driver. * * If not delete them. * * @param DrivingAssertionRepository $drivingAssertionRepository * @param $drivingAssertions * @param Driver $driver */ protected function recheckDrivingAssertions($drivingAssertionRepository, $drivingAssertions, Driver $driver) { /** @var DrivingAssertion $drivingAssertion */ foreach ($drivingAssertions as $drivingAssertion) { if (!$driver->isAvailableOn($drivingAssertion->getShift())) { $drivingAssertion->deletePhysically(); $drivingAssertionRepository->remove($drivingAssertion); } } }