static function getSubscription($subscribed, $url)
 {
     $sub = new RSSCloudSubscription();
     $sub->whereAdd("subscribed = {$subscribed}");
     $sub->whereAdd("url = '{$url}'");
     $sub->limit(1);
     if ($sub->find()) {
         $sub->fetch();
         return $sub;
     }
     return false;
 }
Ejemplo n.º 2
0
 /**
  * Notify all subscribers to a profile feed that it has changed.
  *
  * @param Profile $profile the profile whose feed has been
  *        updated
  *
  * @return boolean success
  */
 function notify($profile)
 {
     $feed = common_path('api/statuses/user_timeline/') . $profile->id . '.rss';
     $cloudSub = new RSSCloudSubscription();
     $cloudSub->subscribed = $profile->id;
     if ($cloudSub->find()) {
         while ($cloudSub->fetch()) {
             $result = $this->postUpdate($cloudSub->url, $feed);
             if ($result == false) {
                 $this->handleFailure($cloudSub);
             }
         }
     }
     return true;
 }