/** * Adds a action method configuration. * * @param \AppserverIo\Routlt\Description\ActionDescriptorInterface $action The action method configuration * * @return void */ public function addAction(ActionDescriptorInterface $action) { $name = $action->getName(); foreach ($action->getRequestMethods() as $method) { $this->actions[$name][$method] = $action; } }
/** * Merges the passed configuration into this one. Configuration values * of the passed configuration will overwrite the this one. * * @param \AppserverIo\Routlt\Description\ActionDescriptorInterface $actionDescriptor The configuration to merge * * @return void * @throws \AppserverIo\Routlt\Description\DescriptorException Is thrown if the passed descriptor has a different method name */ public function merge(ActionDescriptorInterface $actionDescriptor) { // check if the classes are equal if ($this->getMethodName() !== $actionDescriptor->getMethodName()) { throw new DescriptorException(sprintf('You try to merge a action configuration for % with %s', $actionDescriptor->getMethodName(), $this->getMethodName())); } // merge the name if ($name = $actionDescriptor->getName()) { $this->setName($name); } }