1 | <?php |
||
23 | trait AccessorByString |
||
24 | { |
||
25 | use Accessor { |
||
26 | find as parentFind; |
||
27 | } |
||
28 | |||
29 | /** |
||
30 | * @return string |
||
31 | */ |
||
32 | abstract protected static function stringProperty(): string; |
||
33 | |||
34 | /******************************************* |
||
35 | * OVERRIDE |
||
36 | *******************************************/ |
||
37 | |||
38 | /** |
||
39 | * @param $identifier |
||
40 | * @return BaseObject|null |
||
41 | */ |
||
42 | public function find($identifier) |
||
50 | |||
51 | /******************************************* |
||
52 | * FIND STRING |
||
53 | *******************************************/ |
||
54 | |||
55 | /** |
||
56 | * @param string $string |
||
57 | * @return BaseObject|null |
||
58 | */ |
||
59 | public function findByString(string $string) |
||
65 | |||
66 | /** |
||
67 | * @param string $string |
||
68 | * @throws ObjectNotFoundException |
||
69 | * @return BaseObject|null |
||
70 | */ |
||
71 | public function getByString(string $string) |
||
79 | |||
80 | /** |
||
81 | * @param string|null $string |
||
82 | * @throws ObjectNotFoundException |
||
83 | */ |
||
84 | protected function notFoundByStringException(string $string = null) |
||
93 | } |
||
94 |