| @@ 159-180 (lines=22) @@ | ||
| 156 | /** |
|
| 157 | * {@inheritdoc} |
|
| 158 | */ |
|
| 159 | final public function fireView() |
|
| 160 | { |
|
| 161 | if (!method_exists($this, 'callView')) { |
|
| 162 | throw new BadMethodCallException('Not Found Method "callView"'); |
|
| 163 | } |
|
| 164 | ||
| 165 | $view = $this->app->call([$this, 'callView']); |
|
| 166 | ||
| 167 | if (!$view instanceof ViewInterface) { |
|
| 168 | throw new InvalidArgumentException( |
|
| 169 | sprintf( |
|
| 170 | 'callView must be instanced of "%s".', |
|
| 171 | ViewInterface::class |
|
| 172 | ) |
|
| 173 | ); |
|
| 174 | } |
|
| 175 | ||
| 176 | $view->setModel($this->getModel()); |
|
| 177 | $view->initialize(); |
|
| 178 | ||
| 179 | return $view; |
|
| 180 | } |
|
| 181 | ||
| 182 | public function get() |
|
| 183 | { |
|
| @@ 194-213 (lines=20) @@ | ||
| 191 | /** |
|
| 192 | * {@inheritdoc} |
|
| 193 | */ |
|
| 194 | final public function fireCreate() |
|
| 195 | { |
|
| 196 | if (!method_exists($this, 'callCreate')) { |
|
| 197 | return; |
|
| 198 | } |
|
| 199 | ||
| 200 | $form = $this->app->call([$this, 'callCreate']); |
|
| 201 | if (!$form instanceof FormInterface) { |
|
| 202 | throw new InvalidArgumentException( |
|
| 203 | sprintf( |
|
| 204 | 'callCreate must be instanced of "%s".', |
|
| 205 | FormInterface::class |
|
| 206 | ) |
|
| 207 | ); |
|
| 208 | } |
|
| 209 | ||
| 210 | $form->setModel($this->getModel()); |
|
| 211 | ||
| 212 | return $form; |
|
| 213 | } |
|
| 214 | ||
| 215 | /** |
|
| 216 | * {@inheritdoc} |
|