1 | <?php |
||
11 | class Item extends LazyResource |
||
12 | { |
||
13 | /** @var Bib */ |
||
14 | public $bib; |
||
15 | |||
16 | /** @var Holding */ |
||
17 | public $holding; |
||
18 | |||
19 | /** @var string */ |
||
20 | protected $item_id; |
||
21 | |||
22 | /** |
||
23 | * Item constructor. |
||
24 | * |
||
25 | * @param Client $client |
||
26 | * @param Bib $bib |
||
27 | * @param Holding $holding |
||
28 | * @param $item_id |
||
29 | */ |
||
30 | public function __construct(Client $client, Bib $bib, Holding $holding, $item_id) |
||
37 | |||
38 | /** |
||
39 | * Generate the base URL for this resource. |
||
40 | * |
||
41 | * @return string |
||
42 | */ |
||
43 | protected function urlBase() |
||
47 | |||
48 | /** |
||
49 | * Check if we have the full representation of our data object. |
||
50 | * |
||
51 | * @param \stdClass $data |
||
52 | * @return boolean |
||
53 | */ |
||
54 | protected function isInitialized($data) |
||
58 | |||
59 | /** |
||
60 | * Called when data is available to be processed. |
||
61 | * |
||
62 | * @param mixed $data |
||
63 | */ |
||
64 | protected function onData($data) |
||
65 | { |
||
66 | if (isset($this->bib_data)) { |
||
67 | $this->bib->init($this->bib_data); |
||
|
|||
68 | } |
||
69 | if (isset($this->holding_data)) { |
||
70 | $this->holding->init($this->holding_data); |
||
71 | } |
||
72 | } |
||
73 | |||
74 | /** |
||
75 | * Create a new loan. |
||
76 | * |
||
77 | * @param User $user |
||
78 | * @param Library $library |
||
79 | * @param string $circ_desk |
||
80 | * @return Loan |
||
81 | * @throws \Scriptotek\Alma\Exception\RequestFailed |
||
82 | */ |
||
83 | public function checkOut(User $user, Library $library, $circ_desk = 'DEFAULT_CIRC_DESK') |
||
98 | |||
99 | /** |
||
100 | * Perform scan-in on item. |
||
101 | * |
||
102 | * @param Library $library |
||
103 | * @param string $circ_desk |
||
104 | * @param array $params |
||
105 | * @return ScanInResponse |
||
106 | * @throws \Scriptotek\Alma\Exception\RequestFailed |
||
107 | */ |
||
108 | public function scanIn(Library $library, $circ_desk = 'DEFAULT_CIRC_DESK', $params = []) |
||
118 | |||
119 | /** |
||
120 | * Get the current loan as a Loan object, or null if the item is not loaned out. |
||
121 | * |
||
122 | * @returns Loan|null |
||
123 | */ |
||
124 | public function getLoan() |
||
138 | |||
139 | public function __get($key) |
||
159 | } |
||
160 |
Since your code implements the magic getter
_get
, this function will be called for any read access on an undefined variable. You can add the@property
annotation to your class or interface to document the existence of this variable.If the property has read access only, you can use the @property-read annotation instead.
Of course, you may also just have mistyped another name, in which case you should fix the error.
See also the PhpDoc documentation for @property.