-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathoclcResult.php
More file actions
30 lines (27 loc) · 808 Bytes
/
oclcResult.php
File metadata and controls
30 lines (27 loc) · 808 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?php
/*
* Wrapper object for data returned by the kbService class.
* In addition to the raw data that is returned, object of this class contain additional data to format
* output and to generate links between pages of data and associated objects.
* Created by terrywbrady at OCLC Developer House 2014.
*/
class oclcResult {
public $pager;
public $data;
public $opt;
public $header;
public function __construct($json, $data, $opt, $header) {
$this->data = $data;
$this->opt = $opt;
$this->header = $header;
$this->pager = new oclcPager($json);
}
public function getPaginationUrl($index) {
if ($index == null) return null;
$opt = array_merge($this->opt);
$opt['startIndex'] = $index;
$url = $this->opt['page'] . oclcService::makeQuery($opt);
return $url;
}
}
?>