1 | <?php |
||
21 | class AppnexusFacade implements CacheableInterface |
||
22 | { |
||
23 | |||
24 | protected $username; |
||
25 | protected $password; |
||
26 | protected $memberId; |
||
27 | |||
28 | /** @var SegmentRepository */ |
||
29 | private $segmentRepository; |
||
30 | |||
31 | /** @var UserUpload */ |
||
32 | private $userUpload; |
||
33 | |||
34 | /** @var Report */ |
||
35 | private $report; |
||
36 | |||
37 | /** |
||
38 | * AppnexusFacade constructor. |
||
39 | * |
||
40 | * @param $username |
||
41 | * @param $password |
||
42 | * @param $memberId |
||
43 | */ |
||
44 | public function __construct($username, $password, $memberId) |
||
62 | |||
63 | /** |
||
64 | * @param Segment $segment |
||
65 | * |
||
66 | * @return RepositoryResponse |
||
67 | * @throws \Exception |
||
68 | */ |
||
69 | public function add(Segment $segment) |
||
75 | |||
76 | /** |
||
77 | * @param $id |
||
78 | * |
||
79 | * @return RepositoryResponse |
||
80 | */ |
||
81 | public function remove($id) |
||
87 | |||
88 | /** |
||
89 | * @param Segment $segment |
||
90 | * |
||
91 | * @return RepositoryResponse |
||
92 | * @throws \Exception |
||
93 | */ |
||
94 | public function update(Segment $segment) |
||
98 | |||
99 | /** |
||
100 | * @param $id |
||
101 | * |
||
102 | * @return Segment|null |
||
103 | */ |
||
104 | public function findOneById($id) |
||
108 | |||
109 | /** |
||
110 | * @param int $start |
||
111 | * @param int $maxResults |
||
112 | * |
||
113 | * @return array|mixed|null |
||
114 | * @throws \Exception |
||
115 | */ |
||
116 | public function findAll($start = 0, $maxResults = 100) |
||
121 | |||
122 | /** |
||
123 | * @param $fileAsString |
||
124 | * |
||
125 | * @return \Audiens\AppnexusClient\entity\UploadJobStatus |
||
126 | * @throws \Exception |
||
127 | */ |
||
128 | public function upload($fileAsString) |
||
132 | |||
133 | /** |
||
134 | * @param int $start |
||
135 | * @param int $maxResults |
||
136 | * |
||
137 | * @return \Audiens\AppnexusClient\entity\UploadJobStatus[] |
||
138 | * @throws \Audiens\AppnexusClient\exceptions\RepositoryException |
||
139 | */ |
||
140 | public function getUploadHistory($start = 0, $maxResults = 100) |
||
144 | |||
145 | /** |
||
146 | * @return \Audiens\AppnexusClient\entity\UploadTicket |
||
147 | * @throws \Exception |
||
148 | */ |
||
149 | public function getUploadTicket() |
||
153 | |||
154 | /** |
||
155 | * @param UploadTicket $uploadTicket |
||
156 | * |
||
157 | * @return UploadJobStatus $uploadJobStatus |
||
158 | * @throws \Exception |
||
159 | */ |
||
160 | public function getJobStatus(UploadTicket $uploadTicket) |
||
164 | |||
165 | /** |
||
166 | * @param array $reportFormat |
||
167 | * |
||
168 | * @return array |
||
169 | * @throws \Audiens\AppnexusClient\exceptions\RepositoryException |
||
170 | */ |
||
171 | public function getReport($reportFormat = Report::REVENUE_REPORT) |
||
186 | |||
187 | /** |
||
188 | * @return bool |
||
189 | */ |
||
190 | public function isCacheEnabled() |
||
194 | |||
195 | public function disableCache() |
||
200 | |||
201 | public function enableCache() |
||
206 | } |
||
207 |