-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix EZP-28160: Added HTTP Cache purge after copying subtree (#18)
- Loading branch information
Showing
3 changed files
with
84 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
|
||
/** | ||
* This file is part of the eZ Publish Kernel package. | ||
* | ||
* @copyright Copyright (C) eZ Systems AS. All rights reserved. | ||
* @license For full copyright and license information view LICENSE file distributed with this source code. | ||
*/ | ||
namespace EzSystems\PlatformHttpCacheBundle\SignalSlot; | ||
|
||
use eZ\Publish\Core\SignalSlot\Signal; | ||
|
||
/** | ||
* A slot handling CopySubtreeSignal. | ||
*/ | ||
class CopySubtreeSlot extends AbstractContentSlot | ||
{ | ||
protected function generateTags(Signal $signal) | ||
{ | ||
/** @var \eZ\Publish\Core\SignalSlot\Signal\LocationService\CopySubtreeSignal $signal */ | ||
return [ | ||
'location-' . $signal->targetParentLocationId, | ||
'parent-' . $signal->targetParentLocationId, | ||
]; | ||
} | ||
|
||
protected function supports(Signal $signal) | ||
{ | ||
return $signal instanceof Signal\LocationService\CopySubtreeSignal; | ||
} | ||
} |
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,47 @@ | ||
<?php | ||
|
||
/** | ||
* This file is part of the eZ Publish Kernel package. | ||
* | ||
* @copyright Copyright (C) eZ Systems AS. All rights reserved. | ||
* @license For full copyright and license information view LICENSE file distributed with this source code. | ||
*/ | ||
namespace EzSystems\PlatformHttpCacheBundle\Tests\SignalSlot; | ||
|
||
use EzSystems\PlatformHttpCacheBundle\SignalSlot\CopySubtreeSlot; | ||
use eZ\Publish\Core\SignalSlot\Signal\LocationService\CopySubtreeSignal; | ||
|
||
class CopySubtreeSlotTest extends AbstractContentSlotTest | ||
{ | ||
private $subtreeId = 67; | ||
private $targetParentLocationId = 43; | ||
private $targetNewSubtreeId = 45; | ||
|
||
public function createSignal() | ||
{ | ||
return new CopySubtreeSignal([ | ||
'subtreeId' => $this->subtreeId, | ||
'targetParentLocationId' => $this->targetParentLocationId, | ||
'targetNewSubtreeId' => $this->targetNewSubtreeId | ||
]); | ||
} | ||
|
||
public function generateTags() | ||
{ | ||
return [ | ||
'location-' . $this->targetParentLocationId, | ||
'parent-' . $this->targetParentLocationId | ||
]; | ||
} | ||
|
||
public function getSlotClass() | ||
{ | ||
return CopySubtreeSlot::class; | ||
} | ||
|
||
public function getReceivedSignalClasses() | ||
{ | ||
return [CopySubtreeSignal::class]; | ||
} | ||
|
||
} |