src/Application/Tupi/ContentBundle/Module/Builder.php line 36

Open in your IDE?
  1. <?php
  2. // src/Tupi/AdminBundle/Menu/Builder.php
  3. namespace App\Application\Tupi\ContentBundle\Module;
  4. //use Knp\Menu\FactoryInterface;
  5. use Symfony\Component\DependencyInjection\ContainerAwareInterface;
  6. use Symfony\Component\HttpFoundation\Request;
  7. use Symfony\Component\EventDispatcher\EventDispatcherInterface;
  8. use Symfony\Component\EventDispatcher\EventDispatcher;
  9. use Tupi\AdminBundle\Commom\Util;
  10. //use Knp\Menu\MenuItem;
  11. //use Tupi\SecurityBundle\Form\Authorization;
  12. //use Tupi\SecurityBundle\Form\PermissionHelper;
  13. //use Tupi\SecurityBundle\Entity\User;
  14. /* use Symfony\Component\Security\Acl\Domain\UserSecurityIdentity;
  15. use Symfony\Component\Security\Acl\Domain\ObjectIdentity;
  16. use Symfony\Component\Security\Acl\Permission\MaskBuilder; */
  17. use Symfony\Component\Config\Definition\Exception\Exception;
  18. class Builder extends EventDispatcher
  19. {
  20.     //private $factory;
  21.     private $eventDispatcher;
  22.     private $modules = Array();
  23.     
  24.     /**
  25.      * @param FactoryInterface $factory
  26.      * @param EventDispatcherInterface $eventDispatcher
  27.      */
  28.     public function __construct(EventDispatcherInterface $eventDispatcher)
  29.     {
  30.         /*$this->factory = $factory;*/
  31.         $this->eventDispatcher $eventDispatcher;
  32.     }
  33.     
  34.     public function createMainModule($teste)
  35.     {
  36.         
  37.         $this->modules = Array(
  38.                             Array('canonical'=>'user','title'=>'Usuários'),
  39.                             Array('canonical'=>'group','title'=>'Grupos'),
  40.                             //Array('canonical'=>'hierarchy','title'=>'Funções')
  41.                             );
  42.         
  43.         
  44.         
  45.         $teste $this->eventDispatcher->dispatch(BuildEvent::MODULE_BUILDER, new BuildEvent($this->modules));
  46.         
  47.         $this->modules $teste
  48.          
  49.         return $this;
  50.     }
  51.     public function getModules()
  52.     {
  53.         return $this->modules;
  54.     }
  55.     
  56.      
  57. }