1 | <?php |
||
14 | class Bib extends LazyResource |
||
15 | { |
||
16 | /** @var string */ |
||
17 | public $mms_id; |
||
18 | |||
19 | /* @var Holdings */ |
||
20 | public $holdings; |
||
21 | |||
22 | /* @var MarcRecord */ |
||
23 | protected $_marc; |
||
24 | |||
25 | public function __construct(Client $client = null, $mms_id = null) |
||
31 | |||
32 | /** |
||
33 | * Load MARC record onto this Bib object. Chainable method. |
||
34 | * |
||
35 | * @param string $xml |
||
36 | * |
||
37 | * @return Bib |
||
38 | */ |
||
39 | public function setMarcRecord($xml) |
||
49 | |||
50 | /** |
||
51 | * Initialize from SRU record without having to fetch the Bib record. |
||
52 | * @param SruRecord $record |
||
53 | * @param Client|null $client |
||
54 | * @return Bib |
||
55 | */ |
||
56 | public static function fromSruRecord(SruRecord $record, Client $client = null) |
||
64 | |||
65 | public function getHoldings() |
||
69 | |||
70 | public function save() |
||
86 | |||
87 | /** |
||
88 | * Get the MMS ID of the linked record in network zone. |
||
89 | */ |
||
90 | public function getNzMmsId() |
||
104 | |||
105 | /** |
||
106 | * Get the Bib of the linked record in network zone. |
||
107 | */ |
||
108 | public function getNzRecord() |
||
112 | |||
113 | /** |
||
114 | * Returns the MARC record. Load it if we don't have it yet. |
||
115 | */ |
||
116 | public function getRecord() |
||
123 | |||
124 | /** |
||
125 | * Called when data is available to be processed. |
||
126 | * |
||
127 | * @param mixed $data |
||
128 | */ |
||
129 | protected function onData($data) |
||
130 | { |
||
131 | $this->setMarcRecord($data->anies[0]); |
||
132 | } |
||
133 | |||
134 | /** |
||
135 | * Check if we have the full representation of our data object. |
||
136 | * |
||
137 | * @param \stdClass $data |
||
138 | * @return boolean |
||
139 | */ |
||
140 | protected function isInitialized($data) |
||
144 | |||
145 | /** |
||
146 | * Generate the base URL for this resource. |
||
147 | * |
||
148 | * @return string |
||
149 | */ |
||
150 | protected function urlBase() |
||
154 | } |
||
155 |
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):