1 | <?php |
||
10 | class Owner |
||
11 | { |
||
12 | /** |
||
13 | * |
||
14 | * @var string |
||
15 | */ |
||
16 | protected $identifier; |
||
17 | |||
18 | /** |
||
19 | * |
||
20 | * @var AdapterCollection |
||
21 | */ |
||
22 | protected $adapters; |
||
23 | |||
24 | /** |
||
25 | * |
||
26 | * @var Cache |
||
27 | */ |
||
28 | protected $cache; |
||
29 | |||
30 | /** |
||
31 | * |
||
32 | * @param $identifier |
||
33 | * @param Cache $cache |
||
34 | * @param array $adapters |
||
35 | */ |
||
36 | public function __construct($identifier, Cache $cache = null, array $adapters = []) |
||
42 | |||
43 | /** |
||
44 | * |
||
45 | * @return string |
||
46 | */ |
||
47 | public function getIdentifier() |
||
51 | |||
52 | /** |
||
53 | * |
||
54 | * @return AdapterCollection |
||
55 | */ |
||
56 | public function getAdapters() |
||
60 | |||
61 | /** |
||
62 | * |
||
63 | * @param AdapterCollection $adapters |
||
64 | */ |
||
65 | public function setAdapters(AdapterCollection $adapters) |
||
69 | |||
70 | /** |
||
71 | * |
||
72 | * @param Adapter $adapter |
||
73 | */ |
||
74 | public function addAdapter(Adapter $adapter) |
||
78 | |||
79 | /** |
||
80 | * |
||
81 | * @return Cache |
||
82 | */ |
||
83 | public function getCache() |
||
87 | |||
88 | /** |
||
89 | * Upload Asset on all Adapters |
||
90 | * |
||
91 | * @param Asset $asset |
||
92 | */ |
||
93 | public function upload(Asset $asset) |
||
97 | |||
98 | /** |
||
99 | * Edit Asset on all Adapters |
||
100 | * |
||
101 | * @param Asset $asset |
||
102 | */ |
||
103 | public function update(Asset $asset) |
||
107 | |||
108 | /** |
||
109 | * Remove Asset on all Adapters |
||
110 | * |
||
111 | * @param Asset $asset |
||
112 | */ |
||
113 | public function remove(Asset $asset) |
||
117 | |||
118 | /** |
||
119 | * |
||
120 | * @return array |
||
121 | */ |
||
122 | public function getAccounts() |
||
130 | |||
131 | /** |
||
132 | * |
||
133 | * @param $vendor |
||
134 | * @param $credentials |
||
135 | */ |
||
136 | public function setAccount($vendor, $credentials) |
||
147 | |||
148 | /** |
||
149 | * |
||
150 | * @param $identifier |
||
151 | * @param $configurationPath |
||
152 | * @param Cache $cache |
||
153 | * @return Owner |
||
154 | */ |
||
155 | public static function retrieveFromCache($identifier, $configurationPath, Cache $cache) |
||
165 | } |
||
166 |