@@ 87-98 (lines=12) @@ | ||
84 | * @return ObjectWithHandle|null |
|
85 | * @throws ObjectNotFoundException |
|
86 | */ |
|
87 | public function getByHandle(string $handle, string $toScenario = null): ObjectWithHandle |
|
88 | { |
|
89 | ||
90 | if (!$object = $this->findByHandle($handle, $toScenario)) { |
|
91 | ||
92 | $this->notFoundByHandleException($handle); |
|
93 | ||
94 | } |
|
95 | ||
96 | return $object; |
|
97 | ||
98 | } |
|
99 | ||
100 | /** |
|
101 | * @param string $handle |
|
@@ 126-137 (lines=12) @@ | ||
123 | * @return ObjectWithHandle |
|
124 | * @throws ObjectNotFoundException |
|
125 | */ |
|
126 | public function freshGetByHandle(string $handle, string $toScenario = null): ObjectWithHandle |
|
127 | { |
|
128 | ||
129 | if (!$object = $this->freshFindByHandle($handle, $toScenario)) { |
|
130 | ||
131 | $this->notFoundByHandleException($handle); |
|
132 | ||
133 | } |
|
134 | ||
135 | return $object; |
|
136 | ||
137 | } |
|
138 | ||
139 | ||
140 | /******************************************* |