1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Directus\SDK; |
4
|
|
|
|
5
|
|
|
class ClientRemote extends BaseClientRemote implements RequestsInterface |
6
|
|
|
{ |
7
|
|
|
protected $baseEndpoint = 'http://localhost/api'; |
8
|
|
|
protected $hostedBaseEndpointFormat = 'https://%s.directus.io/api'; |
9
|
|
|
|
10
|
|
|
public function fetchTables() |
11
|
|
|
{ |
12
|
|
|
return $this->performRequest('GET', static::TABLE_LIST_ENDPOINT); |
13
|
|
|
} |
14
|
|
|
|
15
|
|
|
public function fetchTableInfo($tableName) |
16
|
|
|
{ |
17
|
|
|
return $this->performRequest('GET', static::TABLE_INFORMATION_ENDPOINT, $tableName); |
18
|
|
|
} |
19
|
|
|
|
20
|
|
|
public function fetchColumns($tableName) |
21
|
|
|
{ |
22
|
|
|
return $this->performRequest('GET', static::COLUMN_LIST_ENDPOINT, $tableName); |
23
|
|
|
} |
24
|
|
|
|
25
|
|
|
public function fetchColumnInfo($tableName, $columnName) |
26
|
|
|
{ |
27
|
|
|
return $this->performRequest('GET', static::COLUMN_INFORMATION_ENDPOINT, [$tableName, $columnName]); |
28
|
|
|
} |
29
|
|
|
|
30
|
|
|
public function getEntries($tableName, array $options = []) |
31
|
|
|
{ |
32
|
|
|
return $this->performRequest('GET', static::TABLE_ENTRIES_ENDPOINT, $tableName); |
|
|
|
|
33
|
|
|
} |
34
|
|
|
|
35
|
|
|
public function getEntry($id, $tableName, array $options = []) |
36
|
|
|
{ |
37
|
|
|
return $this->performRequest('GET', static::TABLE_ENTRY_ENDPOINT, [$tableName, $id]); |
38
|
|
|
} |
39
|
|
|
|
40
|
|
|
public function fetchGroups() |
41
|
|
|
{ |
42
|
|
|
return $this->performRequest('GET', static::GROUP_LIST_ENDPOINT); |
43
|
|
|
} |
44
|
|
|
|
45
|
|
|
public function fetchGroupInfo($groupID) |
46
|
|
|
{ |
47
|
|
|
return $this->performRequest('GET', static::GROUP_INFORMATION_ENDPOINT, $groupID); |
48
|
|
|
} |
49
|
|
|
|
50
|
|
|
public function fetchGroupPrivileges($groupID) |
51
|
|
|
{ |
52
|
|
|
return $this->performRequest('GET', static::GROUP_PRIVILEGES_ENDPOINT, $groupID); |
53
|
|
|
} |
54
|
|
|
|
55
|
|
|
public function fetchFiles() |
56
|
|
|
{ |
57
|
|
|
return $this->performRequest('GET', static::FILE_LIST_ENDPOINT); |
58
|
|
|
} |
59
|
|
|
|
60
|
|
|
public function fetchFileInfo($fileID) |
61
|
|
|
{ |
62
|
|
|
return $this->performRequest('GET', static::FILE_INFORMATION_ENDPOINT, $fileID); |
63
|
|
|
} |
64
|
|
|
|
65
|
|
|
public function fetchSettings() |
66
|
|
|
{ |
67
|
|
|
return $this->performRequest('GET', static::SETTING_LIST_ENDPOINT); |
68
|
|
|
} |
69
|
|
|
|
70
|
|
|
public function fetchSettingCollection($collectionName) |
71
|
|
|
{ |
72
|
|
|
return $this->performRequest('GET', static::SETTING_COLLECTION_ENDPOINT, $collectionName); |
73
|
|
|
} |
74
|
|
|
} |
75
|
|
|
|
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: