1 | <?php |
||
12 | class Item extends LazyResource |
||
13 | { |
||
14 | /** @var Bib */ |
||
15 | public $bib; |
||
16 | |||
17 | /** @var Holding */ |
||
18 | public $holding; |
||
19 | |||
20 | /** @var Requests */ |
||
21 | public $requests; |
||
22 | |||
23 | /** @var string */ |
||
24 | public $item_id; |
||
25 | |||
26 | /** |
||
27 | * Item constructor. |
||
28 | * |
||
29 | * @param Client $client |
||
30 | * @param Bib $bib |
||
31 | * @param Holding $holding |
||
32 | * @param $item_id |
||
33 | */ |
||
34 | public function __construct(Client $client, Bib $bib, Holding $holding, $item_id) |
||
42 | |||
43 | /** |
||
44 | * Generate the base URL for this resource. |
||
45 | * |
||
46 | * @return string |
||
47 | */ |
||
48 | protected function urlBase() |
||
52 | |||
53 | /** |
||
54 | * Save the item. |
||
55 | */ |
||
56 | public function save() |
||
60 | |||
61 | |||
62 | /** |
||
63 | * Check if we have the full representation of our data object. |
||
64 | * |
||
65 | * @param \stdClass $data |
||
66 | * |
||
67 | * @return bool |
||
68 | */ |
||
69 | protected function isInitialized($data) |
||
73 | |||
74 | /** |
||
75 | * Called when data is available to be processed. |
||
76 | * |
||
77 | * @param mixed $data |
||
78 | */ |
||
79 | protected function onData($data) |
||
88 | |||
89 | /** |
||
90 | * Create a new loan. |
||
91 | * |
||
92 | * @param User $user |
||
93 | * @param Library $library |
||
94 | * @param string $circ_desk |
||
95 | * |
||
96 | * @throws \Scriptotek\Alma\Exception\RequestFailed |
||
97 | * |
||
98 | * @return Loan |
||
99 | */ |
||
100 | public function checkOut(User $user, Library $library, $circ_desk = 'DEFAULT_CIRC_DESK') |
||
115 | |||
116 | /** |
||
117 | * Perform scan-in on item. |
||
118 | * |
||
119 | * @param Library $library |
||
120 | * @param string $circ_desk |
||
121 | * @param array $params |
||
122 | * |
||
123 | * @throws \Scriptotek\Alma\Exception\RequestFailed |
||
124 | * |
||
125 | * @return ScanInResponse |
||
126 | */ |
||
127 | public function scanIn(Library $library, $circ_desk = 'DEFAULT_CIRC_DESK', $params = []) |
||
137 | |||
138 | /** |
||
139 | * Get the current loan as a Loan object, or null if the item is not loaned out. |
||
140 | * |
||
141 | * @returns Loan|null |
||
142 | */ |
||
143 | public function getLoan() |
||
155 | |||
156 | public function __get($key) |
||
176 | } |
||
177 |