1 | <?php |
||
20 | class AppnexusFacade implements CacheableInterface |
||
21 | { |
||
22 | |||
23 | protected $username; |
||
24 | protected $password; |
||
25 | protected $memberId; |
||
26 | |||
27 | /** @var SegmentRepository */ |
||
28 | private $segmentRepository; |
||
29 | |||
30 | /** |
||
31 | * AppnexusFacade constructor. |
||
32 | * |
||
33 | * @param $username |
||
34 | * @param $password |
||
35 | * @param $memberId |
||
36 | */ |
||
37 | public function __construct($username, $password, $memberId) |
||
54 | |||
55 | /** |
||
56 | * @param Segment $segment |
||
57 | * |
||
58 | * @return RepositoryResponse |
||
59 | * @throws \Exception |
||
60 | */ |
||
61 | public function add(Segment $segment) |
||
67 | |||
68 | /** |
||
69 | * @param $id |
||
70 | * |
||
71 | * @return RepositoryResponse |
||
72 | */ |
||
73 | public function remove($id) |
||
79 | |||
80 | /** |
||
81 | * @param Segment $segment |
||
82 | * |
||
83 | * @return RepositoryResponse |
||
84 | * @throws \Exception |
||
85 | */ |
||
86 | public function update(Segment $segment) |
||
90 | |||
91 | /** |
||
92 | * @param $id |
||
93 | * |
||
94 | * @return Segment|null |
||
95 | */ |
||
96 | public function findOneById($id) |
||
100 | |||
101 | /** |
||
102 | * @param int $start |
||
103 | * @param int $maxResults |
||
104 | * |
||
105 | * @return array|mixed|null |
||
106 | * @throws \Exception |
||
107 | */ |
||
108 | public function findAll($start = 0, $maxResults = 100) |
||
113 | |||
114 | /** |
||
115 | * @param $fileAsString |
||
116 | * |
||
117 | * @return \Audiens\AppnexusClient\entity\UploadJobStatus |
||
118 | * @throws \Exception |
||
119 | */ |
||
120 | public function upload($fileAsString) |
||
124 | |||
125 | /** |
||
126 | * @return \Audiens\AppnexusClient\entity\UploadTicket |
||
127 | * @throws \Exception |
||
128 | */ |
||
129 | public function getUploadTicket() |
||
133 | |||
134 | /** |
||
135 | * @param UploadTicket $uploadTicket |
||
136 | * |
||
137 | * @return UploadJobStatus $uploadJobStatus |
||
138 | * @throws \Exception |
||
139 | */ |
||
140 | public function getJobStatus(UploadTicket $uploadTicket) |
||
144 | |||
145 | /** |
||
146 | * @return bool |
||
147 | */ |
||
148 | public function isCacheEnabled() |
||
152 | |||
153 | public function disableCache() |
||
158 | |||
159 | public function enableCache() |
||
164 | } |
||
165 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: