Example #1
0
 public function getDescription()
 {
     $this->translator = \Siciarek\AdRotatorBundle\SiciarekAdRotatorBundle::getContainer()->get('translator');
     $temp = array();
     if ($this->getMainpage() === true) {
         $temp[] = $this->translator->trans(self::MAINPAGE, array(), 'SiciarekAdRotator');
     }
     if ($this->getSubpages() === true) {
         $temp[] = $this->translator->trans(self::SUBPAGES, array(), 'SiciarekAdRotator');
     }
     return implode(' + ', $temp);
 }
 public static function getAvailableAds($type)
 {
     $container = \Siciarek\AdRotatorBundle\SiciarekAdRotatorBundle::getContainer();
     $em = $container->get('doctrine.orm.entity_manager');
     $sess = $container->get('session');
     /**
      * @var Query $query
      */
     $query = $em->getRepository('SiciarekAdRotatorBundle:Ad')->createNamedQuery('available')->setParameter('type', $type);
     $ads = $query->getResult();
     return $ads;
 }