1 | <?php |
||
22 | class Command extends Component |
||
23 | { |
||
24 | /** |
||
25 | * @var Connection |
||
26 | */ |
||
27 | public $db; |
||
28 | /** |
||
29 | * @var string|array the indexes to execute the query on. Defaults to null meaning all indexes |
||
30 | */ |
||
31 | public $index; |
||
32 | /** |
||
33 | * @var string|array the types to execute the query on. Defaults to null meaning all types |
||
34 | */ |
||
35 | public $type; |
||
36 | /** |
||
37 | * @var array list of arrays or json strings that become parts of a query |
||
38 | */ |
||
39 | public $queryParts = []; |
||
40 | |||
41 | /** |
||
42 | * Sends a request to the _search API and returns the result. |
||
43 | * @param array $options |
||
44 | * @throws ErrorResponseException |
||
45 | * @return mixed |
||
46 | */ |
||
47 | 1 | public function search($options = []) |
|
48 | { |
||
49 | $url = $this->index . Inflector::id2camel(ArrayHelper::remove($options, 'scenario', 'search')); |
||
50 | 1 | $query = $this->queryParts; |
|
51 | $options = array_merge($query, $options); |
||
52 | |||
53 | return $this->db->post($url, $options); |
||
54 | } |
||
55 | |||
56 | public function getList($options = []) |
||
57 | { |
||
58 | $options = array_merge($this->queryParts, $options); |
||
59 | $command = $this->index . 'GetList'; |
||
60 | $result = $this->db->post($command, $options); |
||
61 | |||
62 | return $result; |
||
63 | } |
||
64 | |||
65 | public function insert($action, $data, $id = null, $options = []) |
||
75 | |||
76 | public function get($modelName, $primaryKey, $options) |
||
80 | |||
81 | public function mget($index, $type, $ids, $options = []) |
||
87 | |||
88 | public function exists($index, $type, $id) |
||
92 | |||
93 | public function delete($index, $id, $options = []) |
||
97 | |||
98 | public function update($index, $id, $data, $options = []) |
||
104 | |||
105 | /** |
||
106 | * @param $action |
||
107 | * @param mixed $body request parameters |
||
108 | * @return mixed |
||
109 | */ |
||
110 | public function perform($action, $body = []) |
||
114 | } |
||
115 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: