/** * Applies grant headers to a command's parameters * * @param AbstractCommand $command Command to be updated * * @return $this */ public function updateCommand(AbstractCommand $command) { $parameters = array(); foreach ($this->grants as $grant) { /** @var $grant Grant */ $parameters = array_merge_recursive($parameters, $grant->getParameterArray()); } foreach ($parameters as $name => $values) { $command->set($name, implode(', ', (array) $values)); } return $this; }