Back to MVCFactory class

Method getClassName

protected string|null
getClassName
(string $suffix, string $prefix)
Returns a standard classname, if the class doesn't exist null is returned.
Parameters
  • string $suffix The suffix
  • string $prefix The prefix
Returns
  • string|null The class name
Since
  • 3.10.0
Class: MVCFactory
Project: Joomla

Method getClassName - Source code

/**
 * Returns a standard classname, if the class doesn't exist null is returned.
 *
 * @param   string  $suffix  The suffix
 * @param   string  $prefix  The prefix
 *
 * @return  string|null  The class name
 *
 * @since   3.10.0
 */
protected function getClassName(string $suffix, string $prefix)
{
    if (!$prefix) {
        $prefix = Factory::getApplication();
    }
    $className = trim($this->namespace, '\\') . '\\' . ucfirst($prefix) . '\\' . $suffix;
    if (!class_exists($className)) {
        return null;
    }
    return $className;
}