1 | <?php |
||
11 | class Collection extends BaseCollection implements CollectionInterface |
||
12 | { |
||
13 | /** |
||
14 | * Create collection instance from raw array. |
||
15 | * |
||
16 | * @param array $data |
||
17 | * @param \Jne\Contracts\MapperInterface $mapper |
||
18 | * |
||
19 | * @return \Jne\Contracts\CollectionsInterface |
||
20 | */ |
||
21 | 4 | public static function fromArray(array $data, MapperInterface $mapper) |
|
22 | { |
||
23 | 4 | return new static($mapper->map($data)); |
|
24 | } |
||
25 | |||
26 | /** |
||
27 | * Create collection instance from HTML node. |
||
28 | * |
||
29 | * @param \Symfony\Component\DomCrawler\Crawler $node |
||
30 | * @param \Jne\Contracts\HtmlMapperInterface $htmlMapper |
||
31 | * |
||
32 | * @return \Jne\Contracts\CollectionsInterface |
||
33 | */ |
||
34 | 2 | public static function fromHtml(Crawler $node, HtmlMapperInterface $htmlMapper) |
|
38 | } |
||
39 |