19 private $relations = [];
21 function __construct($header_value) {
22 $this->params
= new Params($header_value, ",", ";", "=",
23 Params
::PARSE_RFC5988 | Params
::PARSE_ESCAPED
);
24 if ($this->params
->params
) {
25 foreach ($this->params
->params
as $link => $param) {
26 $this->relations
[$param["arguments"]["rel"]] = $link;
31 function getRelations() {
32 return $this->relations
;
36 if (isset($this->relations
["next"])) {
37 return $this->relations
["next"];
39 if (isset($this->relations
["last"])) {
40 return $this->relations
["last"];
46 if (isset($this->relations
["prev"])) {
47 return $this->relations
["prev"];
49 if (isset($this->relations
["first"])) {
50 return $this->relations
["first"];
56 if (isset($this->relations
["last"])) {
57 return $this->relations
["last"];
63 if (isset($this->relations
["first"])) {
64 return $this->relations
["first"];
69 function getPage($which) {
70 if (($link = $this->{"get$which"}())) {
71 $url = new Url($link, null, 0);
72 $qry = new QueryString($url->query
);
73 return $qry->getInt("page", 1);