/** * Add a child module, propagating the adpater settings. * * @api * @param \Nethgui\Module\ModuleInterface $childModule * @return array */ public function addChild(\Nethgui\Module\ModuleInterface $childModule) { if ($this->hasAdapter() && $childModule instanceof AbstractAction) { $childModule->setAdapter($this->getAdapter()); } return parent::addChild($childModule); }
/** * Add $childAction to the TableController, and propagate the table adapter, * if it has not been done yet. * * @param \Nethgui\Module\ModuleInterface $childAction */ public function addChild(\Nethgui\Module\ModuleInterface $childAction) { if ($childAction instanceof \Nethgui\Controller\Table\AbstractAction) { if ($childAction instanceof \Nethgui\Controller\Table\AbstractAction && !$childAction->hasAdapter()) { $childAction->setAdapter($this->getAdapter()); } } return parent::addChild($childAction); }