1 | <?php |
||
11 | class Auction implements AuctionInterface |
||
12 | { |
||
13 | const MAX_PHOTOS = 8; |
||
14 | |||
15 | protected $fields = []; |
||
16 | |||
17 | protected $photos = []; |
||
18 | |||
19 | 18 | public function __construct(array $fields = []) |
|
23 | |||
24 | |||
25 | /** |
||
26 | * Sets photos for auction |
||
27 | * @param array $photos array of photo file paths |
||
28 | */ |
||
29 | 3 | public function setPhotos(array $photos) |
|
39 | |||
40 | |||
41 | /** |
||
42 | * Populate from array |
||
43 | * @param array $fields (WebAPI fid => field value) |
||
44 | * @see Radowoj\Yaah\Decorators\AuctionArrayMapDecorator for an interface more friendly to programmer's sanity :) |
||
45 | */ |
||
46 | 15 | public function fromArray(array $fields) |
|
50 | |||
51 | |||
52 | /** |
||
53 | * Returns WebAPI's representation of an auction (array of fields for doNewAuctionExt()) |
||
54 | * @return array |
||
55 | */ |
||
56 | 5 | public function toApiRepresentation() |
|
70 | |||
71 | |||
72 | /** |
||
73 | * Creates an auction from WebAPI's representation (array of fields from doGetItemFields) |
||
74 | * @param array $fields |
||
75 | */ |
||
76 | 2 | public function fromApiRepresentation(array $fields) |
|
87 | |||
88 | |||
89 | /** |
||
90 | * Add photos to given array of Fields |
||
91 | * @param array& $fields array of Fields to extend with photos |
||
|
|||
92 | */ |
||
93 | 7 | protected function addPhotoFields(array& $fields) |
|
110 | |||
111 | |||
112 | /** |
||
113 | * Simplified array representation (similar to constructor params) |
||
114 | * @return array |
||
115 | */ |
||
116 | 2 | public function toArray() |
|
122 | |||
123 | } |
||
124 |
This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.