1: <?php
2:
3: namespace ShippoClient\Http\Response;
4:
5: use ShippoClient\Entity\Parcel;
6: use ShippoClient\Entity\ParcelCollection;
7: use TurmericSpice\Container;
8:
9: class ParcelList extends ListResponse
10: {
11: /**
12: * @return ParcelCollection
13: */
14: public function getResults()
15: {
16: $entities = [];
17: foreach ($this->attributes->mayHave('results')->asArray() as $attributes) {
18: $entities[] = new Parcel($attributes);
19: }
20:
21: return new ParcelCollection($entities);
22: }
23: }
24: