Completed
Push — master ( 31ac84...e79cb7 )
by Laurent
12:51 queued 09:39
created

AbstractOrdersController::createCreateForm()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 9
rs 9.6666
cc 1
eloc 6
nc 1
nop 1
1
<?php
2
/**
3
 * AbstractOrdersController Méthodes communes InventoryController.
4
 *
5
 * PHP Version 5
6
 *
7
 * @author    Quétier Laurent <[email protected]>
8
 * @copyright 2014 Dev-Int GLSR
9
 * @license   http://opensource.org/licenses/gpl-license.php GNU Public License
10
 *
11
 * @version since 1.0.0
12
 *
13
 * @link      https://github.com/Dev-Int/glsr
14
 */
15
namespace AppBundle\Controller;
16
17
use AppBundle\Controller\AbstractController;
18
use AppBundle\Entity\Orders;
19
use AppBundle\Form\Type\OrdersType;
20
21
/**
22
 * Abstract controller.
23
 *
24
 * @category Controller
25
 */
26
class AbstractOrdersController extends AbstractController
27
{
28
    /**
29
     * Create CreateForm.
30
     *
31
     * @param string $route Route of action form
32
     * @return \Symfony\Component\Form\Form
33
     */
34
    protected function createCreateForm($route)
35
    {
36
        $orders = new Orders();
37
        return $this->createForm(
38
            OrdersType::class,
39
            $orders,
40
            ['attr' => ['id' => 'create'], 'action' => $this->generateUrl($route), 'method' => 'POST',]
41
        );
42
    }
43
}
44