Example #1
0
 public static function createNew($forum, $title, $poster, $body, $notifyReplies)
 {
     $topic = new self(['forum_id' => $forum->forum_id, 'topic_time' => time(), 'topic_title' => $title, 'topic_poster' => $poster->user_id, 'topic_first_poster_name' => $poster->username, 'topic_first_poster_colour' => $poster->user_colour]);
     DB::transaction(function () use($topic, $forum, $title, $poster, $body, $notifyReplies) {
         $topic->save();
         $topic->addPost($poster, $body, $notifyReplies);
     });
     return $topic;
 }
Example #2
0
 /**
  * Filter list by urls matching a regular expression
  *
  * @param  string $regexp
  * @return Zend_Service_Delicious_PostList
  */
 public function withUrl($regexp)
 {
     $postList = new self($this->service);
     foreach ($this->posts as $post) {
         if (preg_match($regexp, $post->getUrl())) {
             $postList->addPost($post);
         }
     }
     return $postList;
 }