| Conditions | 3 |
| Paths | 3 |
| Total Lines | 18 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 36 | public function create($formType, $entity, AdminInterface $admin) |
||
| 37 | { |
||
| 38 | // an valid entity should be passed |
||
| 39 | if (!is_object($entity)) { |
||
| 40 | throw new Exception('Empty entity for form creation'); |
||
| 41 | } |
||
| 42 | |||
| 43 | if (null === $formType) { |
||
| 44 | $form = $this->guessForm($admin); |
||
| 45 | } else { |
||
| 46 | // a form type is defined, we use the form factory |
||
| 47 | $form = $this |
||
| 48 | ->formFactory |
||
| 49 | ->create($formType, $entity); |
||
| 50 | } |
||
| 51 | |||
| 52 | return $form; |
||
| 53 | } |
||
| 54 | |||
| 73 |