Beispiel #1
0
 public function load_object($args)
 {
     $topic_guid = $this->configuration->get('news_topic');
     if (!$topic_guid) {
         throw new midcom_exception_notfound("No news topic defined");
     }
     $data['topic'] = new midgard_topic($topic_guid);
     $qb = midgard_article::new_query_builder();
     $qb->add_constraint('topic', '=', $data['topic']->id);
     $qb->add_constraint('name', '=', $args['name']);
     $articles = $qb->execute();
     if (count($articles) == 0) {
         throw new midcom_exception_notfound("Article {$args['name']} not found.");
     }
     $this->object = $articles[0];
 }