1 | <?php |
||
20 | trait AccessorByString |
||
21 | { |
||
22 | use Accessor { |
||
23 | find as parentFind; |
||
24 | } |
||
25 | |||
26 | /** |
||
27 | * @return string |
||
28 | */ |
||
29 | abstract protected static function stringProperty(): string; |
||
30 | |||
31 | /******************************************* |
||
32 | * OVERRIDE |
||
33 | *******************************************/ |
||
34 | |||
35 | /** |
||
36 | * @param $identifier |
||
37 | * @return Record|null |
||
38 | */ |
||
39 | public function find($identifier) |
||
47 | |||
48 | /******************************************* |
||
49 | * FIND STRING |
||
50 | *******************************************/ |
||
51 | |||
52 | /** |
||
53 | * @param string $string |
||
54 | * @return Record|null |
||
55 | */ |
||
56 | public function findByString(string $string) |
||
62 | |||
63 | /** |
||
64 | * @param string $string |
||
65 | * @throws RecordNotFoundException |
||
66 | * @return Record|null |
||
67 | */ |
||
68 | public function getByString(string $string) |
||
76 | |||
77 | /** |
||
78 | * @param string|null $string |
||
79 | * @throws RecordNotFoundException |
||
80 | */ |
||
81 | protected function notFoundByStringException(string $string = null) |
||
90 | } |
||
91 |