File tree 1 file changed +7
-5
lines changed
1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -68,12 +68,12 @@ public function getUser(string $field, $value): Struct\UserInfo
68
68
}
69
69
70
70
/**
71
- * @param string $field
71
+ * @param string|null $field
72
72
* @param int|string $value
73
73
*
74
74
* @return Struct\Info[]
75
75
*/
76
- public function getAll (string $ field , $ value ): array
76
+ public function getAll (? string $ field , $ value ): array
77
77
{
78
78
$ response = $ this ->getBy ('get-db ' , $ field , $ value );
79
79
$ items = [];
@@ -107,18 +107,20 @@ public function getAllUsers(string $field, $value): array
107
107
108
108
/**
109
109
* @param string $command
110
- * @param string $field
110
+ * @param string|null $field
111
111
* @param int|string $value
112
112
*
113
113
* @return XmlResponse
114
114
*/
115
- private function getBy (string $ command , string $ field , $ value ): XmlResponse
115
+ private function getBy (string $ command , ? string $ field , $ value ): XmlResponse
116
116
{
117
117
$ packet = $ this ->client ->getPacket ();
118
118
$ getTag = $ packet ->addChild ($ this ->wrapperTag )->addChild ($ command );
119
119
120
120
$ filterTag = $ getTag ->addChild ('filter ' );
121
- $ filterTag ->{$ field } = (string ) $ value ;
121
+ if (!is_null ($ field )) {
122
+ $ filterTag ->{$ field } = (string ) $ value ;
123
+ }
122
124
123
125
return $ this ->client ->request ($ packet , \PleskX \Api \Client::RESPONSE_FULL );
124
126
}
You can’t perform that action at this time.
0 commit comments