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

getLocationsToClear() public method

Returns all location objects registered to the cache clear process.
public getLocationsToClear ( ) : eZ\Publish\API\Repository\Values\Content\Location[]
return eZ\Publish\API\Repository\Values\Content\Location[]
    public function getLocationsToClear()
    {
        return $this->locationsToClear;
    }

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());
 }