-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathoclcData.php
More file actions
40 lines (32 loc) · 824 Bytes
/
oclcData.php
File metadata and controls
40 lines (32 loc) · 824 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
31
32
33
34
35
36
37
38
39
40
<?php
/*
* Data object base class containing convenience methods for reading JSON.
* Created by terrywbrady at OCLC Developer House 2014.
*/
class oclcData {
public function getJson($entry, $key, $default = "") {
if (isset($entry[$key])) return $entry[$key];
return $default;
}
public function getVal($key) {
$arr = get_object_vars($this);
return $arr[$key];
}
public function getLinkOptions($key) {
return array();
}
}
/*
* Configuration class defining the attributes of an oclcData object.
* Created by terrywbrady at OCLC Developer House 2014.
*/
class oclcDataAttr {
public $id;
public $name;
public $summaryView;
public function __construct($id, $name, $summaryView = false) {
$this->id = $id;
$this->name = $name;
$this->summaryView = $summaryView;
}
}