forked from oroinc/orocommerce
/
ShoppingListController.php
67 lines (59 loc) · 1.68 KB
/
ShoppingListController.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<?php
namespace OroB2B\Bundle\ShoppingListBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
use Oro\Bundle\SecurityBundle\Annotation\AclAncestor;
use Oro\Bundle\SecurityBundle\Annotation\Acl;
use OroB2B\Bundle\ShoppingListBundle\Entity\ShoppingList;
class ShoppingListController extends Controller
{
/**
* @Route("/view/{id}", name="orob2b_shopping_list_view", requirements={"id"="\d+"})
* @Template
* @Acl(
* id="orob2b_shopping_list_view",
* type="entity",
* class="OroB2BShoppingListBundle:ShoppingList",
* permission="VIEW"
* )
*
* @param ShoppingList $shoppingList
*
* @return array
*/
public function viewAction(ShoppingList $shoppingList)
{
return [
'entity' => $shoppingList
];
}
/**
* @Route("/info/{id}", name="orob2b_shopping_list_info", requirements={"id"="\d+"})
* @Template
* @AclAncestor("orob2b_shopping_list_view")
*
* @param ShoppingList $shoppingList
*
* @return array
*/
public function infoAction(ShoppingList $shoppingList)
{
return [
'shopping_list' => $shoppingList
];
}
/**
* @Route("/", name="orob2b_shopping_list_index")
* @Template
* @AclAncestor("orob2b_shopping_list_view")
*
* @return array
*/
public function indexAction()
{
return [
'entity_class' => $this->container->getParameter('orob2b_shopping_list.entity.shopping_list.class')
];
}
}