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 | * Check if we have the full representation of our data object. |
||
55 | * |
||
56 | * @param \stdClass $data |
||
57 | * |
||
58 | * @return bool |
||
59 | */ |
||
60 | protected function isInitialized($data) |
||
64 | |||
65 | /** |
||
66 | * Called when data is available to be processed. |
||
67 | * |
||
68 | * @param mixed $data |
||
69 | */ |
||
70 | protected function onData($data) |
||
79 | |||
80 | /** |
||
81 | * Create a new loan. |
||
82 | * |
||
83 | * @param User $user |
||
84 | * @param Library $library |
||
85 | * @param string $circ_desk |
||
86 | * |
||
87 | * @throws \Scriptotek\Alma\Exception\RequestFailed |
||
88 | * |
||
89 | * @return Loan |
||
90 | */ |
||
91 | public function checkOut(User $user, Library $library, $circ_desk = 'DEFAULT_CIRC_DESK') |
||
106 | |||
107 | /** |
||
108 | * Perform scan-in on item. |
||
109 | * |
||
110 | * @param Library $library |
||
111 | * @param string $circ_desk |
||
112 | * @param array $params |
||
113 | * |
||
114 | * @throws \Scriptotek\Alma\Exception\RequestFailed |
||
115 | * |
||
116 | * @return ScanInResponse |
||
117 | */ |
||
118 | public function scanIn(Library $library, $circ_desk = 'DEFAULT_CIRC_DESK', $params = []) |
||
128 | |||
129 | /** |
||
130 | * Get the current loan as a Loan object, or null if the item is not loaned out. |
||
131 | * |
||
132 | * @returns Loan|null |
||
133 | */ |
||
134 | public function getLoan() |
||
146 | |||
147 | public function __get($key) |
||
167 | } |
||
168 |