eZ\Publish\Core\MVC\Symfony\Event\ContentCacheClearEvent::setLocationsToClear PHP Метод

setLocationsToClear() публичный Метод

Replaces the list of locations to clear.
public setLocationsToClear ( array $locationsToClear )
$locationsToClear array
    public function setLocationsToClear(array $locationsToClear)
    {
        $this->locationsToClear = $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());
 }