예제 #1
0
파일: Module.php 프로젝트: efueger/gewisweb
 /**
  * Get service configuration.
  *
  * @return array Service configuration
  */
 public function getServiceConfig()
 {
     return array('invokables' => array('frontpage_service_frontpage' => 'Frontpage\\Service\\Frontpage', 'frontpage_service_page' => 'Frontpage\\Service\\Page'), 'factories' => array('frontpage_form_page' => function ($sm) {
         $form = new \Frontpage\Form\Page($sm->get('translator'));
         $form->setHydrator($sm->get('frontpage_hydrator_page'));
         return $form;
     }, 'frontpage_hydrator_page' => function ($sm) {
         return new \DoctrineModule\Stdlib\Hydrator\DoctrineObject($sm->get('frontpage_doctrine_em'), 'Frontpage\\Model\\Page');
     }, 'frontpage_mapper_page' => function ($sm) {
         return new Mapper\Page($sm->get('frontpage_doctrine_em'));
     }, 'frontpage_acl' => function ($sm) {
         $acl = $sm->get('acl');
         $acl->addResource('page');
         return $acl;
     }, 'frontpage_doctrine_em' => function ($sm) {
         return $sm->get('doctrine.entitymanager.orm_default');
     }));
 }
예제 #2
0
 /**
  * Get service configuration.
  *
  * @return array Service configuration
  */
 public function getServiceConfig()
 {
     return ['invokables' => ['frontpage_service_frontpage' => 'Frontpage\\Service\\Frontpage', 'frontpage_service_page' => 'Frontpage\\Service\\Page', 'frontpage_service_poll' => 'Frontpage\\Service\\Poll', 'frontpage_service_news' => 'Frontpage\\Service\\News'], 'factories' => ['frontpage_form_page' => function ($sm) {
         $form = new \Frontpage\Form\Page($sm->get('translator'));
         $form->setHydrator($sm->get('frontpage_hydrator'));
         return $form;
     }, 'frontpage_form_poll' => function ($sm) {
         $form = new \Frontpage\Form\Poll($sm->get('translator'));
         $form->setHydrator($sm->get('frontpage_hydrator'));
         return $form;
     }, 'frontpage_form_poll_comment' => function ($sm) {
         $form = new \Frontpage\Form\PollComment($sm->get('translator'));
         $form->setHydrator($sm->get('frontpage_hydrator'));
         return $form;
     }, 'frontpage_form_poll_approval' => function ($sm) {
         $form = new \Frontpage\Form\PollApproval($sm->get('translator'));
         $form->setHydrator($sm->get('frontpage_hydrator'));
         return $form;
     }, 'frontpage_form_news_item' => function ($sm) {
         $form = new \Frontpage\Form\NewsItem($sm->get('translator'));
         $form->setHydrator($sm->get('frontpage_hydrator'));
         return $form;
     }, 'frontpage_hydrator' => function ($sm) {
         return new \DoctrineModule\Stdlib\Hydrator\DoctrineObject($sm->get('frontpage_doctrine_em'));
     }, 'frontpage_mapper_page' => function ($sm) {
         return new Mapper\Page($sm->get('frontpage_doctrine_em'));
     }, 'frontpage_mapper_poll' => function ($sm) {
         return new Mapper\Poll($sm->get('frontpage_doctrine_em'));
     }, 'frontpage_mapper_news_item' => function ($sm) {
         return new Mapper\NewsItem($sm->get('frontpage_doctrine_em'));
     }, 'frontpage_acl' => function ($sm) {
         $acl = $sm->get('acl');
         $acl->addResource('page');
         $acl->addResource('poll');
         $acl->addResource('poll_comment');
         $acl->addResource('news_item');
         $acl->allow('user', 'poll', ['vote', 'request']);
         $acl->allow('user', 'poll_comment', ['view', 'create', 'list']);
         return $acl;
     }, 'frontpage_doctrine_em' => function ($sm) {
         return $sm->get('doctrine.entitymanager.orm_default');
     }]];
 }