1 | <?php |
||
18 | trait LookupTrait |
||
19 | { |
||
20 | /** |
||
21 | * @var int|null |
||
22 | */ |
||
23 | public $statusCodeNotFound; |
||
24 | |||
25 | /** |
||
26 | * @var string|null |
||
27 | */ |
||
28 | public $messageNotFound; |
||
29 | |||
30 | /** |
||
31 | * @param mixed $object |
||
32 | * @return mixed|Response |
||
33 | */ |
||
34 | abstract protected function runInternal($object); |
||
35 | |||
36 | /** |
||
37 | * @param string|int $identifier |
||
38 | * @return mixed|null |
||
39 | */ |
||
40 | abstract protected function find($identifier); |
||
41 | |||
42 | /** |
||
43 | * @param $identifier |
||
44 | * @return mixed|null|Response |
||
45 | * @throws HttpException |
||
46 | */ |
||
47 | public function run($identifier) |
||
55 | |||
56 | /** |
||
57 | * @return string |
||
58 | */ |
||
59 | protected function messageNotFound(): string |
||
63 | |||
64 | /** |
||
65 | * HTTP not found response code |
||
66 | * |
||
67 | * @return int |
||
68 | */ |
||
69 | protected function statusCodeNotFound(): int |
||
73 | |||
74 | /** |
||
75 | * @return null |
||
76 | * @throws HttpException |
||
77 | */ |
||
78 | protected function handleNotFoundResponse() |
||
85 | } |
||
86 |