/** * @param int $index The action index * @param string $id The item id * * @return int The number of executed actions */ protected function executeDependedRemoveAction($index, $id) { $executedCount = 0; if (isset($this->links[self::REMOVE][$id])) { $executedCount += $this->executeLinkedAction(self::GROUP_REMOVE, self::REMOVE, $index, $id); } if (0 === $executedCount) { $aliases = $this->rawLayoutBuilder->getAliases($this->rawLayoutBuilder->resolveId($id)); foreach ($aliases as $alias) { $executedCount += $this->executeLinkedAction(self::GROUP_REMOVE, self::REMOVE, $index, $alias); if (0 !== $executedCount) { break; } } } if (0 === $executedCount && $this->rawLayoutBuilder->has($id)) { $parentId = $this->rawLayoutBuilder->getParentId($id); if ($parentId) { $executedCount += $this->executeDependedRemoveAction($index, $parentId); } } return $executedCount; }
/** * {@inheritdoc} */ public function getParentId() { return $this->rawLayoutBuilder->getParentId($this->id); }