protected function getChildren(ContentNode $parentNode) { $contents = ContentCacheBuilder::getInstance()->getData(array(), 'contents'); $children = array(); foreach ($contents as $content) { if ($content->parentID == $parentNode->contentID) { $children[$content->contentID] = $content; } } return $children; }
protected function init() { $this->pages = PageCacheBuilder::getInstance()->getData(array(), 'pages'); $this->contents = ContentCacheBuilder::getInstance()->getData(array(), 'contents'); $list = new StylesheetList(); $list->readObjects(); $this->stylesheets = $list->getObjects(); $this->categoryObjectType = ObjectTypeCache::getInstance()->getObjectTypeByName('com.woltlab.wcf.category', 'de.codequake.cms.file'); $list = new CategoryList(); $list->getConditionBuilder()->add("objectTypeID = ?", array($this->categoryObjectType->objectTypeID)); $list->readObjects(); $this->folders = $list->getObjects(); $list = new FileList(); $list->readObjects(); $this->files = $list->getObjects(); }
/** * @see \wcf\data\ISortableAction::validateUpdatePosition() */ public function validateUpdatePosition() { WCF::getSession()->checkPermissions(array('admin.cms.content.canAddContent')); if (!isset($this->parameters['data']['structure']) || !is_array($this->parameters['data']['structure'])) { throw new UserInputException('structure'); } $contents = ContentCacheBuilder::getInstance()->getData(array(), 'contents'); foreach ($this->parameters['data']['structure'] as $parentID => $contentIDs) { if ($parentID) { if (!isset($contents[$parentID])) { throw new UserInputException('structure'); } $this->objects[$parentID] = new ContentEditor($contents[$parentID]); } foreach ($contentIDs as $contentID) { if (!isset($contents[$contentID])) { throw new UserInputException('structure'); } $this->objects[$contentID] = new ContentEditor($contents[$contentID]); } } }
protected function init() { $this->tree = ContentCacheBuilder::getInstance()->getData(array(), 'tree'); $this->contents = ContentCacheBuilder::getInstance()->getData(array(), 'contents'); }
/** * @see \wcf\data\IEditableCachedObject::resetCache() */ public static function resetCache() { ContentCacheBuilder::getInstance()->reset(); }