]> git.mxchange.org Git - friendica.git/commitdiff
Remove extraneous $field parameter in Contact\Relation methods
authorHypolite Petovan <hypolite@mrpetovan.com>
Wed, 5 Aug 2020 02:44:18 +0000 (22:44 -0400)
committerHypolite Petovan <hypolite@mrpetovan.com>
Wed, 5 Aug 2020 02:44:23 +0000 (22:44 -0400)
src/Model/Contact/Relation.php
src/Model/GContact.php

index a5bd0e9b7dfd7e858dd832f9278219d04218b88f..cc0570ec63a2dcd0746a7f40089be190cd27e2c7 100644 (file)
@@ -431,7 +431,7 @@ class Relation
         * @return array
         * @throws Exception
         */
-       public static function listCommon(int $sourceId, int $targetId, array $fields = [], array $condition = [], int $count = 30, int $offset = 0, bool $shuffle = false)
+       public static function listCommon(int $sourceId, int $targetId, array $condition = [], int $count = 30, int $offset = 0, bool $shuffle = false)
        {
                $condition = DBA::mergeConditions($condition,
                        ["`id` IN (SELECT `relation-cid` FROM `contact-relation` WHERE `cid` = ? AND `follows`) 
@@ -439,7 +439,7 @@ class Relation
                        $sourceId, $targetId]
                );
 
-               return DI::dba()->selectToArray('contact', $fields, $condition,
+               return DI::dba()->selectToArray('contact', [], $condition,
                        ['limit' => [$offset, $count], 'order' => [$shuffle ? 'name' : 'RAND()']]
                );
        }
@@ -470,7 +470,6 @@ class Relation
         *
         * @param int   $sourceId  Public contact id
         * @param int   $targetId  Public contact id
-        * @param array $field     Field list
         * @param array $condition Additional condition array on the contact table
         * @param int   $count
         * @param int   $offset
@@ -478,7 +477,7 @@ class Relation
         * @return array
         * @throws Exception
         */
-       public static function listCommonFollows(int $sourceId, int $targetId, array $fields = [], array $condition = [], int $count = 30, int $offset = 0, bool $shuffle = false)
+       public static function listCommonFollows(int $sourceId, int $targetId, array $condition = [], int $count = 30, int $offset = 0, bool $shuffle = false)
        {
                $condition = DBA::mergeConditions($condition,
                        ["`id` IN (SELECT `relation-cid` FROM `contact-relation` WHERE `cid` = ? AND `follows`) 
@@ -486,7 +485,7 @@ class Relation
                        $sourceId, $targetId]
                );
 
-               return DI::dba()->selectToArray('contact', $fields, $condition,
+               return DI::dba()->selectToArray('contact', [], $condition,
                        ['limit' => [$offset, $count], 'order' => [$shuffle ? 'name' : 'RAND()']]
                );
        }
@@ -516,7 +515,6 @@ class Relation
         *
         * @param int   $sourceId  Public contact id
         * @param int   $targetId  Public contact id
-        * @param array $field     Field list
         * @param array $condition Additional condition on the contact table
         * @param int   $count
         * @param int   $offset
@@ -524,7 +522,7 @@ class Relation
         * @return array
         * @throws Exception
         */
-       public static function listCommonFollowers(int $sourceId, int $targetId, array $fields = [], array $condition = [], int $count = 30, int $offset = 0, bool $shuffle = false)
+       public static function listCommonFollowers(int $sourceId, int $targetId, array $condition = [], int $count = 30, int $offset = 0, bool $shuffle = false)
        {
                $condition = DBA::mergeConditions($condition,
                        ["`id` IN (SELECT `cid` FROM `contact-relation` WHERE `relation-cid` = ? AND `follows`) 
@@ -532,7 +530,7 @@ class Relation
                        $sourceId, $targetId]
                );
 
-               return DI::dba()->selectToArray('contact', $fields, $condition,
+               return DI::dba()->selectToArray('contact', [], $condition,
                        ['limit' => [$offset, $count],  'order' => [$shuffle ? 'name' : 'RAND()']]
                );
        }
index 097b43456a4aded10be99feb80b9cebfd5db75e8..3fe123e15f2ac6d300ead4fb69d407acf36f01f9 100644 (file)
@@ -46,7 +46,7 @@ class GContact
                        $sourceId,
                ];
 
-               return Contact\Relation::countCommonFollows($sourceId, $targetIds['public'] ?? 0, [], $condition);
+               return Contact\Relation::countCommonFollows($sourceId, $targetIds['public'] ?? 0, $condition);
        }
 
        /**
@@ -74,7 +74,7 @@ LIMIT 1",
                        $sourceId,
                ];
 
-               return Contact\Relation::countCommonFollowers($sourceId, $targetPublicContact['id'] ?? 0, [], $condition);
+               return Contact\Relation::countCommonFollowers($sourceId, $targetPublicContact['id'] ?? 0, $condition);
        }
 
        /**
@@ -100,7 +100,7 @@ LIMIT 1",
                        $sourceId,
                ];
 
-               return Contact\Relation::listCommonFollows($sourceId, $targetIds['public'] ?? 0, [], $condition, $limit, $start, $shuffle);
+               return Contact\Relation::listCommonFollows($sourceId, $targetIds['public'] ?? 0, $condition, $limit, $start, $shuffle);
        }
 
        /**
@@ -134,6 +134,6 @@ LIMIT 1",
                        $sourceId,
                ];
 
-               return Contact\Relation::listCommonFollows($sourceId, $targetPublicContact['id'] ?? 0, [], $condition, $limit, $start, $shuffle);
+               return Contact\Relation::listCommonFollows($sourceId, $targetPublicContact['id'] ?? 0, $condition, $limit, $start, $shuffle);
        }
 }