1: <?php
2:
3: namespace ShippoClient\Http\Response;
4:
5: use ShippoClient\Entity\EntityCollection;
6: use TurmericSpice\ReadWriteAttributes;
7:
8: abstract class ListResponse
9: {
10: use ReadWriteAttributes {
11: mayHaveAsInt as public getCount;
12: toArray as public __toArray;
13: }
14:
15: public function getNext()
16: {
17: return $this->attributes->mayHave('next')->value();
18: }
19:
20: public function getPrevious()
21: {
22: return $this->attributes->mayHave('previous')->value();
23: }
24:
25: public function toArray()
26: {
27: $array = $this->__toArray();
28: $array['results'] = $this->getResults()->toArray();
29:
30: return $array;
31: }
32:
33: 34: 35:
36: abstract public function getResults();
37: }
38: