Skip to content

Commit

Permalink
EZP-31113: AssignSectionToSubtreeSignal is not handled by search and …
Browse files Browse the repository at this point in the history
…HTTP cache (#106)

* Added missing header
* Added missing slot definition
* Fixed incorrect parent class
* Update for 1.0
  • Loading branch information
kmadejski authored Feb 3, 2020
1 parent ac5149d commit 1a503b8
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Resources/config/slot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -255,3 +255,8 @@ services:
class: EzSystems\PlatformHttpCacheBundle\SignalSlot\SectionService\UpdateSectionSlot
parent: ezplatform.http_cache.signalslot.abstract
tags: [{ name: ezpublish.api.slot, signal: SectionService\UpdateSectionSignal }]

ezplatform.http_cache.signalslot.assign_section_to_subtree:
class: EzSystems\PlatformHttpCacheBundle\SignalSlot\SectionService\AssignSectionToSubtreeSlot
parent: ezplatform.http_cache.signalslot.abstract
tags: [{ name: ezpublish.api.slot, signal: SectionService\AssignSectionToSubtreeSignal }]
35 changes: 35 additions & 0 deletions src/SignalSlot/SectionService/AssignSectionToSubtreeSlot.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?php

/**
* @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\SectionService;

use eZ\Publish\Core\SignalSlot\Signal;
use EzSystems\PlatformHttpCacheBundle\SignalSlot\AbstractContentSlot;

/**
* A slot handling AssignSectionToSubtreeSignal.
*/
class AssignSectionToSubtreeSlot extends AbstractContentSlot
{
/**
* {@inheritdoc}
*/
protected function supports(Signal $signal)
{
return $signal instanceof Signal\SectionService\AssignSectionToSubtreeSignal;
}

/**
* {@inheritdoc}
*/
protected function generateTags(Signal $signal)
{
$tags = parent::generateTags($signal);
$tags[] = 'p' . $signal->locationId;

return $tags;
}
}

0 comments on commit 1a503b8

Please sign in to comment.