1 | <?php |
||
14 | class LinksArray implements ObjectInterface { |
||
15 | /** @var array with string|LinkObject */ |
||
16 | protected $links = []; |
||
17 | |||
18 | /** |
||
19 | * human api |
||
20 | */ |
||
21 | |||
22 | /** |
||
23 | * @param string[] $hrefs |
||
24 | * @return LinksArray |
||
25 | */ |
||
26 | public static function fromArray(array $hrefs) { |
||
35 | |||
36 | /** |
||
37 | * @param object $hrefs |
||
38 | * @return LinksArray |
||
39 | */ |
||
40 | public static function fromObject($hrefs) { |
||
45 | |||
46 | /** |
||
47 | * @param string $href |
||
48 | * @param array $meta optional, if given a LinkObject is added, otherwise a link string is added |
||
49 | */ |
||
50 | public function add($href, array $meta=[]) { |
||
58 | |||
59 | /** |
||
60 | * spec api |
||
61 | */ |
||
62 | |||
63 | /** |
||
64 | * @param string $href |
||
65 | */ |
||
66 | public function addLinkString($href) { |
||
69 | |||
70 | /** |
||
71 | * @param LinkObject $linkObject |
||
72 | */ |
||
73 | public function addLinkObject(LinkObject $linkObject) { |
||
76 | |||
77 | /** |
||
78 | * ObjectInterface |
||
79 | */ |
||
80 | |||
81 | /** |
||
82 | * @inheritDoc |
||
83 | */ |
||
84 | public function isEmpty() { |
||
87 | |||
88 | /** |
||
89 | * @inheritDoc |
||
90 | */ |
||
91 | public function toArray() { |
||
105 | } |
||
106 |