/** * @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); }
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); }
/** * Checks if this is an XHR request. * * @return bool */ public function isXhr() { return $this->server->get('X_REQUESTED_WITH') == 'XMLHttpRequest'; }
/** * 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'); }