/** * Use only append to fill this object, must start with top elements * @param PlaceHolder $placeHolder */ public function append($placeHolder) { if (!$placeHolder instanceof PlaceHolder) { throw new \LogicException(__METHOD__ . " accepts PlaceHolder arguments only"); } if (isset($this->localization)) { $placeHolderName = $placeHolder->getName(); // Add to final in cases when it's the page place or locked one if ($placeHolder->getLocked() || $placeHolder->getMaster()->equals($this->localization)) { // Ignore if already set locked place with higher hierarchy level if ($this->finalPlaceHolderSet->offsetExists($placeHolderName)) { return; } $this->finalPlaceHolderSet->offsetSet($placeHolderName, $placeHolder); } else { // collect not matched template place holders to search for locked blocks $this->parentPlaceHolderSet->append($placeHolder); } } parent::append($placeHolder); }