eZ\Publish\Core\MVC\Symfony\Event\ContentCacheClearEvent::addLocationToClear PHP Method

addLocationToClear() public method

Adds a location that needs to be cleared.
public addLocationToClear ( eZ\Publish\API\Repository\Values\Content\Location $location )
$location eZ\Publish\API\Repository\Values\Content\Location
    public function addLocationToClear(Location $location)
    {
        $this->locationsToClear[] = $location;
    }

Usage Example

 public function setLocationsToClear()
 {
     $contentInfo = new ContentInfo();
     $event = new ContentCacheClearEvent($contentInfo);
     $initialLocations = [new Location(), new Location()];
     $event->addLocationToClear($initialLocations[0]);
     $event->addLocationToClear($initialLocations[1]);
     $this->assertSame($initialLocations, $event->getLocationsToClear());
     $otherLocations = [new Location(), new Location()];
     $event->setLocationsToClear($otherLocations);
     $this->assertSame($otherLocations, $event->getLocationsToClear());
 }
All Usage Examples Of eZ\Publish\Core\MVC\Symfony\Event\ContentCacheClearEvent::addLocationToClear