Skip to content

Commit

Permalink
changes from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
noam-arad committed Apr 3, 2017
1 parent da4978f commit b9b1706
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions plugins/schedule/base/lib/kScheduleEventsConsumer.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,13 +122,16 @@ public function updateScheduleEvent($eventId)

protected function scheduleEventChanged(ScheduleEvent $scheduleEvent, $modifiedColumns)
{
$scheduleEvents = ScheduleEventResourcePeer::retrieveByEventId($scheduleEvent->getId());
foreach ($scheduleEvents as $currScheduleEvent)
if (in_array($scheduleEvent->getStatus(), ScheduleEventStatus::DELETED, ScheduleEventStatus::CANCELLED))
{
/**
* @var ScheduleEventResource $currScheduleEvent
*/
$currScheduleEvent->delete();
$scheduleEvents = ScheduleEventResourcePeer::retrieveByEventId($scheduleEvent->getId());
foreach ($scheduleEvents as $currScheduleEvent)
{
/**
* @var ScheduleEventResource $currScheduleEvent
*/
$currScheduleEvent->delete();
}
}
}

Expand Down

0 comments on commit b9b1706

Please sign in to comment.