/** * Gets the class methods' names * * @param string $class The class name or an object instance * @param string $top_class Top class name * * @return array */ public function getClassMethods($class, $top_class = null) { $methods = array(); foreach (get_class_methods($class) as $_method) { if (!is_method_overridden($class, $_method)) { continue; } if ($_method && $_method != "__construct") { $methods[] = $_method; } } if ($top_class && $top_class != ($parent_class = get_parent_class($class))) { $methods = array_merge($methods, $this->getClassMethods($parent_class, $top_class)); } return $methods; }
/** * Construit un tableau de traduction des classes pour lesquelles la fonction filltemplate existe * * @return array */ static function getTemplatedClasses() { if (self::$templated_classes !== null) { return self::$templated_classes; } $all_classes = array("CConsultAnesth", "CConsultation", "COperation", "CPatient", "CSejour", "CFactureCabinet", "CFactureEtablissement", 'CDevisCodage'); if (CModule::getActive("dPprescription")) { $all_classes[] = "CPrescription"; } $installed = CApp::getInstalledClasses($all_classes); $classes = array(); foreach ($installed as $class) { if (is_method_overridden($class, 'fillTemplate') || is_method_overridden($class, 'fillLimitedTemplate')) { $classes[$class] = CAppUI::tr($class); } } if (!count($classes)) { $classes["CMbObject"] = CAppUI::tr("CMbObject"); } return self::$templated_classes = $classes; }