| @@ 220-241 (lines=22) @@ | ||
| 217 | /** |
|
| 218 | * {@inheritdoc} |
|
| 219 | */ |
|
| 220 | final public function fireDisplay() |
|
| 221 | { |
|
| 222 | if (! method_exists($this, 'callDisplay')) { |
|
| 223 | throw new BadMethodCallException('Not Found Method "callDisplay"'); |
|
| 224 | } |
|
| 225 | ||
| 226 | $display = $this->app->call([$this, 'callDisplay']); |
|
| 227 | ||
| 228 | if (! ($display instanceof DisplayInterface)) { |
|
| 229 | throw new InvalidArgumentException( |
|
| 230 | sprintf( |
|
| 231 | 'callDisplay must be instanced of "%s".', |
|
| 232 | DisplayInterface::class |
|
| 233 | ) |
|
| 234 | ); |
|
| 235 | } |
|
| 236 | ||
| 237 | $display->setModel($this->getModel()); |
|
| 238 | $display->initialize(); |
|
| 239 | ||
| 240 | return $display; |
|
| 241 | } |
|
| 242 | ||
| 243 | public function get() |
|
| 244 | { |
|
| @@ 253-272 (lines=20) @@ | ||
| 250 | /** |
|
| 251 | * {@inheritdoc} |
|
| 252 | */ |
|
| 253 | final public function fireCreate() |
|
| 254 | { |
|
| 255 | if (! method_exists($this, 'callCreate')) { |
|
| 256 | return; |
|
| 257 | } |
|
| 258 | ||
| 259 | $form = $this->app->call([$this, 'callCreate']); |
|
| 260 | if (! $form instanceof FormInterface) { |
|
| 261 | throw new InvalidArgumentException( |
|
| 262 | sprintf( |
|
| 263 | 'callCreate must be instanced of "%s".', |
|
| 264 | FormInterface::class |
|
| 265 | ) |
|
| 266 | ); |
|
| 267 | } |
|
| 268 | ||
| 269 | $form->setModel($this->getModel()); |
|
| 270 | ||
| 271 | return $form; |
|
| 272 | } |
|
| 273 | ||
| 274 | /** |
|
| 275 | * {@inheritdoc} |
|