public function copyToTargetCategory(StackCategory $category) { $list = new StackList(); $list->filterByStackCategory($this); $stacks = $list->get(); foreach ($stacks as $stack) { $stack->duplicate($category->getPage()); } }
protected function setupMultilingualStackList(\Concrete\Core\Page\Stack\StackList $list) { if (\Core::make('multilingual/detector')->isEnabled()) { $category = StackCategory::getCategoryFromMultilingualSection($this->getSelectedLanguage()); if (!is_object($category)) { // we have to create the category $category = StackCategory::createFromMultilingualSection($this->getSelectedLanguage()); // now we copy all the stacks into it $default = StackCategory::getFromDefaultMultilingualSection(); $default->copyToTargetCategory($category); } $list->filterByStackCategory($category); } }
public function filterByStackCategory(Concrete\Core\Page\Stack\StackCategory $category) { return parent::filterByStackCategory($category); }