1 | <?php |
||
15 | class Bib extends LazyResource |
||
16 | { |
||
17 | /** @var string */ |
||
18 | public $mms_id; |
||
19 | |||
20 | /* @var Holdings */ |
||
21 | public $holdings; |
||
22 | |||
23 | /* @var MarcRecord */ |
||
24 | protected $_marc; |
||
25 | |||
26 | public function __construct(Client $client = null, $mms_id = null) |
||
32 | |||
33 | /** |
||
34 | * Get the model data. This API does not support JSON for editing, |
||
35 | * so we fetch XML instead. |
||
36 | */ |
||
37 | protected function fetchData() |
||
41 | |||
42 | /** |
||
43 | * Load MARC record onto this Bib object. Chainable method. |
||
44 | * |
||
45 | * @param string $xml |
||
46 | * |
||
47 | * @return Bib |
||
48 | */ |
||
49 | public function setMarcRecord($xml) |
||
56 | |||
57 | /** |
||
58 | * Initialize from SRU record without having to fetch the Bib record. |
||
59 | * @param SruRecord $record |
||
60 | * @param Client|null $client |
||
61 | * @return Bib |
||
62 | */ |
||
63 | public static function fromSruRecord(SruRecord $record, Client $client = null) |
||
71 | |||
72 | /** |
||
73 | * For backwards-compability. |
||
74 | */ |
||
75 | public function getHoldings() |
||
79 | |||
80 | /** |
||
81 | * Save the MARC record. |
||
82 | */ |
||
83 | public function save() |
||
101 | |||
102 | /** |
||
103 | * Get the MMS ID of the linked record in network zone. |
||
104 | */ |
||
105 | public function getNzMmsId() |
||
118 | |||
119 | /** |
||
120 | * Get the Bib of the linked record in network zone. |
||
121 | */ |
||
122 | public function getNzRecord() |
||
126 | |||
127 | /** |
||
128 | * Returns the MARC record. Load it if we don't have it yet. |
||
129 | */ |
||
130 | public function getRecord() |
||
137 | |||
138 | /** |
||
139 | * Called when data is available to be processed. |
||
140 | * |
||
141 | * @param mixed $data |
||
142 | */ |
||
143 | protected function onData($data) |
||
147 | |||
148 | /** |
||
149 | * Check if we have the full representation of our data object. |
||
150 | * |
||
151 | * @param $data |
||
152 | * @return boolean |
||
153 | */ |
||
154 | protected function isInitialized($data) |
||
158 | |||
159 | /** |
||
160 | * Generate the base URL for this resource. |
||
161 | * |
||
162 | * @return string |
||
163 | */ |
||
164 | protected function urlBase() |
||
168 | |||
169 | /** |
||
170 | * Magic! |
||
171 | * @param string $key |
||
172 | * @return mixed |
||
173 | */ |
||
174 | public function __get($key) |
||
186 | } |
||
187 |
It seems like you allow that null is being passed for a parameter, however the function which is called does not seem to accept null.
We recommend to add an additional type check (or disallow null for the parameter):