/** * Tries to get the name of an action (edit, delete, list, new, save) for a given object-type. * Example: Converts list to listOtherObject for the object class_module_demo_demo if the annotation * @ objectListOtherObject class_module_demo_demo is declared * * @param string $strAction * @param $objInstance * * @return string */ protected function getActionNameForClass($strAction, $objInstance) { if (isset(self::$arrActionNameMapping[$strAction])) { $strAnnotationPrefix = self::$arrActionNameMapping[$strAction]; if ($strAction == "new") { return $strAction . $this->getStrCurObjectTypeName(); } else { $objReflection = new class_reflection($this); $arrAnnotations = $objReflection->getAnnotationsWithValueFromClass(get_class($objInstance)); foreach ($arrAnnotations as $strProperty) { if (uniStrpos($strProperty, $strAnnotationPrefix) === 0) { return $strAction . uniSubstr($strProperty, uniStrlen($strAnnotationPrefix)); } } } } return parent::getActionNameForClass($strAction, $objInstance); }