/** * set the defaults on the given BaseEventTypeElement * * Looks for a methods based on the class name of the element: * setElementDefaultOptions_[element class name] * * This method is passed the element and action, which allows for controller methods to manipulate the default * values of the element (if the controller state is required for this) * * @param BaseEventTypeElement $element * @param string $action */ protected function setElementDefaultOptions($element, $action) { if ($action == 'create') { $element->setDefaultOptions(); } elseif ($action == 'update') { $element->setUpdateOptions(); } $el_method = 'setElementDefaultOptions_' . Helper::getNSShortname($element); if (method_exists($this, $el_method)) { $this->{$el_method}($element, $action); } }