Ejemplo n.º 1
0
 /**
  * Comment an entry
  *
  * @param  User_Model        $user
  * @param  Blog_Entry_Model  $entry
  */
 public static function comment(User_Model $user = null, Blog_Entry_Model $entry = null)
 {
     if ($user && $entry) {
         newsfeeditem::add($user->id, 'blog', self::TYPE_COMMENT, array('entry_id' => (int) $entry->id));
     }
 }
Ejemplo n.º 2
0
 /**
  * Start a new topic
  *
  * @param  User_Model         $user
  * @param  Forum_Topic_Model  $topic
  */
 public static function topic(User_Model $user = null, Forum_Topic_Model $topic = null)
 {
     if ($user && $topic) {
         newsfeeditem::add($user->id, 'forum', self::TYPE_TOPIC, array('topic_id' => (int) $topic->id));
     }
 }
Ejemplo n.º 3
0
 /**
  * Add new login event
  *
  * @param  User_Model  $user
  */
 public static function login(User_Model $user = null)
 {
     if ($user) {
         newsfeeditem::add($user->id, 'user', self::TYPE_LOGIN);
     }
 }
Ejemplo n.º 4
0
 /**
  * Add an event to favorites
  *
  * @param  User_Model   $user
  * @param  Event_Model  $event
  */
 public static function favorite(User_Model $user = null, Event_Model $event = null)
 {
     if ($user && $event) {
         newsfeeditem::add($user->id, 'events', self::TYPE_FAVORITE, array('event_id' => (int) $event->id));
     }
 }
Ejemplo n.º 5
0
 /**
  * Comment an image
  *
  * @param  User_Model     $user
  * @param  Gallery_Model  $gallery
  * @param  Image_Model    $image
  */
 public static function comment(User_Model $user = null, Gallery_Model $gallery = null, Image_Model $image = null)
 {
     if ($user && $gallery && $image) {
         newsfeeditem::add($user->id, 'galleries', self::TYPE_COMMENT, array('gallery_id' => (int) $gallery->id, 'image_id' => (int) $image->id));
     }
 }