-
Notifications
You must be signed in to change notification settings - Fork 349
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'remotes/dev/1.10' into 1.10
- Loading branch information
Showing
95 changed files
with
1,972 additions
and
224 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
src/Oro/Bundle/CalendarBundle/Datagrid/MassAction/DeleteMassActionHandler.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<?php | ||
|
||
namespace Oro\Bundle\CalendarBundle\Datagrid\MassAction; | ||
|
||
use Doctrine\ORM\EntityManager; | ||
|
||
use Oro\Bundle\DataGridBundle\Extension\MassAction\DeleteMassActionHandler as ParentHandler; | ||
|
||
/** | ||
* Class DeleteMassActionHandler | ||
* | ||
* @package Oro\Bundle\CalendarBundle\Datagrid\MassAction | ||
*/ | ||
class DeleteMassActionHandler extends ParentHandler | ||
{ | ||
/** | ||
* {@inheritDoc} | ||
*/ | ||
protected function processDelete($entity, EntityManager $manager) | ||
{ | ||
if ($entity->getRecurringEvent()) { | ||
$event = $entity->getRealCalendarEvent(); | ||
$event->setCancelled(true); | ||
|
||
$childEvents = $event->getChildEvents(); | ||
foreach ($childEvents as $childEvent) { | ||
$childEvent->setCancelled(true); | ||
} | ||
} else { | ||
if ($entity->getRecurrence() && $entity->getRecurrence()->getId()) { | ||
$manager->remove($entity->getRecurrence()); | ||
} | ||
|
||
if ($entity->getRecurringEvent()) { | ||
$event = $entity->getRealCalendarEvent(); | ||
$childEvents = $event->getChildEvents(); | ||
foreach ($childEvents as $childEvent) { | ||
$manager->remove($childEvent); | ||
} | ||
} | ||
$manager->remove($entity); | ||
} | ||
|
||
return $this; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.