@@ 263-275 (lines=13) @@ | ||
260 | * @return Object |
|
261 | * @throws ObjectNotFoundException |
|
262 | */ |
|
263 | public function getById(int $id, string $toScenario = null): Object |
|
264 | { |
|
265 | ||
266 | // Find by ID |
|
267 | if (!$object = $this->findById($id, $toScenario)) { |
|
268 | ||
269 | $this->notFoundByIdException($id); |
|
270 | ||
271 | } |
|
272 | ||
273 | return $object; |
|
274 | ||
275 | } |
|
276 | ||
277 | /** |
|
278 | * @param int $id |
|
@@ 303-314 (lines=12) @@ | ||
300 | * @return Object |
|
301 | * @throws ObjectNotFoundException |
|
302 | */ |
|
303 | public function freshGetById(int $id, string $toScenario = null): Object |
|
304 | { |
|
305 | ||
306 | if (!$object = $this->freshFindById($id, $toScenario)) { |
|
307 | ||
308 | $this->notFoundByIdException($id); |
|
309 | ||
310 | } |
|
311 | ||
312 | return $object; |
|
313 | ||
314 | } |
|
315 | ||
316 | /******************************************* |
|
317 | * FIND/GET BY QUERY |