summaryrefslogtreecommitdiff
path: root/app/Models/UserQuery.php
diff options
context:
space:
mode:
Diffstat (limited to 'app/Models/UserQuery.php')
-rw-r--r--app/Models/UserQuery.php18
1 files changed, 18 insertions, 0 deletions
diff --git a/app/Models/UserQuery.php b/app/Models/UserQuery.php
index 26264fa24..6050436f4 100644
--- a/app/Models/UserQuery.php
+++ b/app/Models/UserQuery.php
@@ -350,4 +350,22 @@ class FreshRSS_UserQuery {
public function setImageUrl(string $imageUrl): void {
$this->imageUrl = $imageUrl;
}
+
+ /**
+ * Remove queries where $get is appearing.
+ * @param string $get the get attribute which should be removed.
+ * @param array<int,array{get?:string,name?:string,order?:string,search?:string,state?:int,url?:string,token?:string,
+ * shareRss?:bool,shareOpml?:bool,description?:string,imageUrl?:string}> $queries an array of queries.
+ * @return array<int,array{get?:string,name?:string,order?:string,search?:string,state?:int,url?:string,token?:string,
+ * shareRss?:bool,shareOpml?:bool,description?:string,imageUrl?:string}> without queries where $get is appearing.
+ */
+ public static function remove_query_by_get(string $get, array $queries): array {
+ $final_queries = [];
+ foreach ($queries as $query) {
+ if (empty($query['get']) || $query['get'] !== $get) {
+ $final_queries[] = $query;
+ }
+ }
+ return $final_queries;
+ }
}