public function get_root_category() { $config = MediaConfig::load(); $root = new MediaCategory(); $root->set_id(Category::ROOT_CATEGORY); $root->set_id_parent(Category::ROOT_CATEGORY); $root->set_name(LangLoader::get_message('root', 'main')); $root->set_rewrited_name('root'); $root->set_order(0); $root->set_authorizations($config->get_authorizations()); $root->set_description($config->get_root_category_description()); $root->set_content_type($config->get_root_category_content_type()); return $root; }
/** * Creates individual Entry objects of the appropriate type and * stores them in the $_entry array based upon DOM data. * * @param DOMNode $child The DOMNode to process */ protected function takeChildFromDOM($child) { $absoluteNodeName = $child->namespaceURI . ':' . $child->localName; switch ($absoluteNodeName) { case $this->lookupNamespace('media') . ':' . 'content': $content = new MediaContent(); $content->transferFromDOM($child); $this->_content[] = $content; break; case $this->lookupNamespace('media') . ':' . 'category': $category = new MediaCategory(); $category->transferFromDOM($child); $this->_category[] = $category; break; case $this->lookupNamespace('media') . ':' . 'copyright': $copyright = new MediaCopyright(); $copyright->transferFromDOM($child); $this->_copyright = $copyright; break; case $this->lookupNamespace('media') . ':' . 'credit': $credit = new MediaCredit(); $credit->transferFromDOM($child); $this->_credit[] = $credit; break; case $this->lookupNamespace('media') . ':' . 'description': $description = new MediaDescription(); $description->transferFromDOM($child); $this->_description = $description; break; case $this->lookupNamespace('media') . ':' . 'hash': $hash = new MediaHash(); $hash->transferFromDOM($child); $this->_hash[] = $hash; break; case $this->lookupNamespace('media') . ':' . 'keywords': $keywords = new MediaKeywords(); $keywords->transferFromDOM($child); $this->_keywords = $keywords; break; case $this->lookupNamespace('media') . ':' . 'player': $player = new MediaPlayer(); $player->transferFromDOM($child); $this->_player[] = $player; break; case $this->lookupNamespace('media') . ':' . 'rating': $rating = new MediaRating(); $rating->transferFromDOM($child); $this->_rating[] = $rating; break; case $this->lookupNamespace('media') . ':' . 'restriction': $restriction = new MediaRestriction(); $restriction->transferFromDOM($child); $this->_restriction[] = $restriction; break; case $this->lookupNamespace('media') . ':' . 'text': $text = new MediaText(); $text->transferFromDOM($child); $this->_mediaText[] = $text; break; case $this->lookupNamespace('media') . ':' . 'thumbnail': $thumbnail = new MediaThumbnail(); $thumbnail->transferFromDOM($child); $this->_thumbnail[] = $thumbnail; break; case $this->lookupNamespace('media') . ':' . 'title': $title = new MediaTitle(); $title->transferFromDOM($child); $this->_title = $title; break; default: parent::takeChildFromDOM($child); break; } }
private function create_media_cats_table() { MediaCategory::create_categories_table(self::$media_cats_table); }