| 1 | <?php |
||
| 7 | class FormManager |
||
| 8 | { |
||
| 9 | private $requestStack; |
||
| 10 | private $creators; |
||
| 11 | |||
| 12 | public function __construct(RequestStack $requestStack) |
||
| 13 | { |
||
| 14 | $this->creators = new \SplPriorityQueue; |
||
| 15 | $this->requestStack = $requestStack; |
||
| 16 | } |
||
| 17 | |||
| 18 | public function createObjectForm($object, $purpose = null, array $options = array()) |
||
| 28 | |||
| 29 | public function createBoundObjectForm($object, $purpose = null, array $options = array()) |
||
| 30 | { |
||
| 31 | if (!$this->getRequest()->isMethodSafe()) { |
||
| 32 | $options = array_merge(array('method' => $this->getRequest()->getMethod()), $options); |
||
| 33 | } |
||
| 34 | $form = $this->createObjectForm($object, $purpose, $options); |
||
| 35 | $form->handleRequest($this->getRequest()); |
||
| 36 | |||
| 37 | return $form; |
||
| 38 | } |
||
| 39 | |||
| 40 | public function registerCreator(FormCreatorInterface $creator, $priority = 0) |
||
| 44 | |||
| 45 | public function getCreators() |
||
| 49 | |||
| 50 | private function getRequest() |
||
| 51 | { |
||
| 54 | } |
||
| 55 |