private function __construct()
 {
     $this->sessionContext = SessionContext::instance();
     $this->pageContext = PageContext::instance();
     $this->requestContext = RequestContext::instance();
     $this->eventContext = EventContext::instance();
 }
 public function beforeAction()
 {
     $this->contexts = Contexts::instance();
     $this->reqCon = RequestContext::instance();
     $this->sesCon = SessionContext::instance();
     $this->em = Zool::app()->em;
 }
 public function getRequestContext()
 {
     if (null == $this->requestContext) {
         $this->requestContext = RequestContext::instance();
     }
     return $this->requestContext;
 }
 public function search()
 {
     $user = Contexts::instance()->get('identity');
     $em = Zool::app()->entityManager;
     $search = Contexts::instance()->get('estate_search');
     $estates = $em->createQuery('select b from app\\model\\Estate b where b.owner = :owner and b.name = :name')->setParameter('owner', $user->id)->setParameter('name', "%{$search}%")->getResult();
     RequestContext::instance()->set('estatesList', $estates);
 }
 public function dom()
 {
     RequestContext::instance()->set('foo', true);
     RequestContext::instance()->set('bar', rand(1, 20));
     $colors = array('blue', 'red', 'orange', 'green', 'gray', 'yellow');
     $c = $colors[array_rand($colors, 1)];
     RequestContext::instance()->set('color', $c);
     \shuffle($colors);
     SessionContext::instance()->set('colors', $colors);
     RequestContext::instance()->set('title', $c);
 }
 public function sayHello($name = 'Johnson', $prefix = 'Pie', $boo = '4')
 {
     $em = Zool::app()->em;
     if ($this->count > 10) {
         $this->count = 1;
     }
     $this->list = $em->createQuery('select b from app\\model\\Bug b where b.id > 1')->setFirstResult(0)->setMaxResults(15)->getResult();
     PageContext::instance()->set('list', $this->list);
     RequestContext::instance()->set('listcount', count($this->list));
     SessionContext::instance()->set('count', $this->count++);
     PageContext::instance()->set('textboxvalue', 'Szöveg');
     return 'Helloka ' . $name . ' ' . $prefix . ' ' . $boo;
 }