예제 #1
0
 /**
  * @param $name
  * @param null $default
  * @return mixed
  */
 public function get($name, $default = null)
 {
     if ($result = $this->query->get($name, $default)) {
         return $result;
     }
     if ($result = $this->request->get($name, $default)) {
         return $result;
     }
     return $default;
 }
 /**
  * Quick entity pager based on configured name
  * 
  * @remote
  * @Secure("ROLE_ADMIN")
  *
  * @param ParameterBag $params 
  */
 public function listAction($params)
 {
     $lists = $this->container->getParameter('hatimeria_ext_js.exposed_lists');
     if (isset($lists[$params->get('name')])) {
         $class = $lists[$params->get('name')]['class'];
     } else {
         return new Failure("No exposed lists with name: " . $params->get('name'));
     }
     return $this->get('hatimeria_extjs.pager')->fromEntity($class, $params);
 }
예제 #3
0
 public function testIsImmutable()
 {
     $bag = new ParameterBag(['foo' => $std = new \stdClass()]);
     // Mutate injected object
     $std->foo = 'bar';
     // Mutate retrieved object
     $bag->get('foo')->foo = 'baz';
     $this->assertEquals(new ParameterBag(['foo' => new \stdClass()]), $bag);
 }
예제 #4
0
 /**
  * Checks if this is an XHR request.
  *
  * @return bool
  */
 public function isXhr()
 {
     return $this->server->get('X_REQUESTED_WITH') == 'XMLHttpRequest';
 }
예제 #5
0
 /**
  * Returns the HTTP method of this request.
  *
  * @return string The HTTP method of the request
  */
 public function getMethod()
 {
     return $this->server->get('REQUEST_METHOD', 'GET');
 }