]> git.mxchange.org Git - friendica.git/commitdiff
Renamed functions
authorMichael <heluecht@pirati.ca>
Sun, 9 May 2021 18:44:08 +0000 (18:44 +0000)
committerMichael <heluecht@pirati.ca>
Sun, 9 May 2021 18:44:08 +0000 (18:44 +0000)
src/Factory/Api/Mastodon/ListEntity.php
src/Factory/Api/Mastodon/Notification.php
src/Module/Api/Mastodon/Accounts/Lists.php
src/Module/Api/Mastodon/Lists.php
src/Module/Api/Mastodon/Notifications.php

index 57547e438ac659e36aa38efbeefabd54735e1a2b..a149b25af2bdd0f4a77cd30d770bc13b3e4ef9b2 100644 (file)
@@ -26,7 +26,7 @@ use Friendica\Database\DBA;
 
 class ListEntity extends BaseFactory
 {
-       public function create(int $id)
+       public function createFromGroupId(int $id)
        {
                $group = DBA::selectFirst('group', ['name'], ['id' => $id, 'deleted' => false]);
                return new \Friendica\Object\Api\Mastodon\ListEntity($id, $group['name'] ?? '', 'list');
index d9588b450d4c01908f073253c25116f5a07a107d..db5e7d489824254b95a0ee91a24341f23fdffa15 100644 (file)
@@ -29,7 +29,7 @@ use Friendica\Model\Notification as ModelNotification;
 
 class Notification extends BaseFactory
 {
-       public function create(int $id)
+       public function createFromNotifyId(int $id)
        {
                $notification = DBA::selectFirst('notify', [], ['id' => $id]);
                if (!DBA::isResult($notification)) {
index 95677dad6daf8e75fcd2796fdb280da90a866f5a..b15124a45c83ff27418ce7a2f5a3ac673b1c9570 100644 (file)
@@ -56,7 +56,7 @@ class Lists extends BaseApi
                if (!empty($cdata['user'])) {
                        $groups = DBA::select('group_member', ['gid'], ['contact-id' => $cdata['user']]);
                        while ($group = DBA::fetch($groups)) {
-                               $lists[] = DI::mstdnList()->create($group['gid']);
+                               $lists[] = DI::mstdnList()->createFromGroupId($group['gid']);
                        }
                        DBA::close($groups);
                }
index f65ef51395835dc5e2b0704c43a9001be654d93e..d9f9c6e5a8d7e4a96db2d65426c12b1ef96b85b8 100644 (file)
@@ -60,7 +60,7 @@ class Lists extends BaseApi
 
                        $groups = DBA::select('group', ['id'], ['uid' => $uid, 'deleted' => false]);
                        while ($group = DBA::fetch($groups)) {
-                               $lists[] = DI::mstdnList()->create($group['id']);
+                               $lists[] = DI::mstdnList()->createFromGroupId($group['id']);
                        }
                        DBA::close($groups);
                } else {
@@ -68,7 +68,7 @@ class Lists extends BaseApi
                        if (!DBA::exists('group',['uid' => $uid, 'deleted' => false])) {
                                DI::mstdnError()->RecordNotFound();
                        }
-                       $lists = DI::mstdnList()->create($id);
+                       $lists = DI::mstdnList()->createFromGroupId($id);
                }
 
                System::jsonExit($lists);
index 8f1b1d2d97f42420d500ce83fa19415bcb51aed7..a10ebf5d507087fed3aa5ab8ad030c8a837836a0 100644 (file)
@@ -47,7 +47,7 @@ class Notifications extends BaseApi
                        if (!DBA::exists('notify', ['id' => $id, 'uid' => $uid])) {
                                DI::mstdnError()->RecordNotFound();
                        }
-                       System::jsonExit(DI::mstdnNotification()->create($id));
+                       System::jsonExit(DI::mstdnNotification()->createFromNotifyId($id));
                }
 
                // Return results older than this ID
@@ -110,7 +110,7 @@ class Notifications extends BaseApi
 
                $notify = DBA::select('notify', ['id'], $condition, $params);
                while ($notification = DBA::fetch($notify)) {
-                       $notifications[] = DI::mstdnNotification()->create($notification['id']);
+                       $notifications[] = DI::mstdnNotification()->createFromNotifyId($notification['id']);
                }
 
                if (!empty($min_id)) {