get() public method

public get ( $path, $default = null, $deep = false )
Esempio n. 1
0
 /**
  * @return string
  *
  * @throws \LogicException
  */
 public function getGrid()
 {
     if (!$this->hasGrid()) {
         throw new \LogicException('Current action does not use grid.');
     }
     return $this->parameters->get('grid');
 }
Esempio n. 2
0
 /**
  * @param string $key
  *
  * @return string
  */
 private function getParameterName($key)
 {
     $parameterName = $this->parameters->get('parameter_name');
     if (isset($parameterName[$key]) && !is_array($parameterName[$key])) {
         return $parameterName[$key];
     }
     return $key;
 }
Esempio n. 3
0
 /**
  * @return bool
  */
 public function isHeaderRedirection()
 {
     $redirect = $this->parameters->get('redirect');
     if (!is_array($redirect) || !isset($redirect['header'])) {
         return false;
     }
     if ('xhr' === $redirect['header']) {
         return $this->getRequest()->isXmlHttpRequest();
     }
     return (bool) $redirect['header'];
 }
Esempio n. 4
0
 public function getSerializationVersion()
 {
     return $this->parameters->get('serialization_version');
 }
Esempio n. 5
0
 public function getPermission($default = null)
 {
     return $this->parameters->get('permission', $default);
 }
 function it_does_not_have_grid_unless_defined_as_in_parameters(Parameters $parameters)
 {
     $parameters->has('grid')->willReturn(false);
     $this->shouldNotHaveGrid();
     $parameters->has('grid')->willReturn(true);
     $this->shouldHaveGrid();
     $parameters->has('grid')->willReturn(true);
     $parameters->get('grid')->willReturn('sylius_admin_tax_category');
     $this->getGrid()->shouldReturn('sylius_admin_tax_category');
 }
 function it_has_section(Parameters $parameters)
 {
     $parameters->get('section')->willReturn(null);
     $this->getSection()->shouldReturn(null);
     $parameters->get('section')->willReturn('admin');
     $this->getSection()->shouldReturn('admin');
 }
 function it_can_have_state_machine_transition(Parameters $parameters)
 {
     $parameters->has('state_machine')->willReturn(false);
     $this->hasStateMachine()->shouldReturn(false);
     $parameters->has('state_machine')->willReturn(true);
     $parameters->get('state_machine[graph]', null, true)->willReturn('sylius_product_review_state');
     $parameters->get('state_machine[transition]', null, true)->willReturn('approve');
     $this->hasStateMachine()->shouldReturn(true);
     $this->getStateMachineGraph()->shouldReturn('sylius_product_review_state');
     $this->getStateMachineTransition()->shouldReturn('approve');
 }
Esempio n. 9
0
 function it_has_sortable_position_parameter(Parameters $parameters)
 {
     $parameters->get('sortable_position', 'position')->willReturn('position');
     $this->getSortablePosition()->shouldReturn('position');
     $parameters->get('sortable_position', 'position')->willReturn('myPosition');
     $this->getSortablePosition()->shouldReturn('myPosition');
 }
Esempio n. 10
0
 /**
  * @return string|null
  */
 private function getSection()
 {
     return $this->parameters->get('section');
 }
Esempio n. 11
0
 /**
  * @return bool
  */
 public function isCsrfProtectionEnabled()
 {
     return $this->parameters->get('csrf_protection', true);
 }
Esempio n. 12
0
 /**
  * @return string
  */
 public function getStateMachineTransition()
 {
     return $this->parameters->get('state_machine[transition]', null, true);
 }
Esempio n. 13
0
 public function getBatches()
 {
     return $this->parameters->get('batches', []);
 }