]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Use Profile objects in Subscription::saveNew
authorMikael Nordfeldth <mmn@hethane.se>
Sun, 6 Sep 2015 00:04:12 +0000 (02:04 +0200)
committerMikael Nordfeldth <mmn@hethane.se>
Sun, 6 Sep 2015 00:07:52 +0000 (02:07 +0200)
classes/Subscription.php

index 16bab350d9b518a2a95edd5c7ace8569dde16a03..314a597f55e681e08a55e1adc26a25327384c523 100644 (file)
@@ -101,7 +101,7 @@ class Subscription extends Managed_DataObject
                     $sub = Subscription_queue::getSubQueue($subscriber, $other);
                 }
             } else {
                     $sub = Subscription_queue::getSubQueue($subscriber, $other);
                 }
             } else {
-                $sub = self::saveNew($subscriber->id, $other->id);
+                $sub = self::saveNew($subscriber, $other);
                 $sub->notify();
 
                 self::blow('user:notices_with_friends:%d', $subscriber->id);
                 $sub->notify();
 
                 self::blow('user:notices_with_friends:%d', $subscriber->id);
@@ -150,12 +150,12 @@ class Subscription extends Managed_DataObject
      * Low-level subscription save.
      * Outside callers should use Subscription::start()
      */
      * Low-level subscription save.
      * Outside callers should use Subscription::start()
      */
-    protected static function saveNew($subscriber_id, $other_id)
+    protected static function saveNew(Profile $subscriber, Profile $other)
     {
         $sub = new Subscription();
 
     {
         $sub = new Subscription();
 
-        $sub->subscriber = $subscriber_id;
-        $sub->subscribed = $other_id;
+        $sub->subscriber = $subscriber->getID();
+        $sub->subscribed = $other->getID();
         $sub->jabber     = 1;
         $sub->sms        = 1;
         $sub->created    = common_sql_now();
         $sub->jabber     = 1;
         $sub->sms        = 1;
         $sub->created    = common_sql_now();