base/ExtensionHelperTrait.php
public static function validate($class)
    {
        if ($class instanceof \rhoone\extension\Extension) {
            $class = $class->className();
        }
        if ($class instanceof \rhoone\models\Extension) {
            $class = $class->classname;
        }
        if (!is_string($class)) {
            Yii::error('the class name is not a string.', __METHOD__);
            throw new InvalidParamException('the class name is not a string. (' . __METHOD__ . ')');
        }
        Yii::trace('validate extension: `' . $class . '`', __METHOD__);

        $class = static::normalizeClass($class);
        $extension = static::validateExtension($class);
        $dic = DictionaryManager::validate($extension);
        return $extension;
    }
public static function validate($class)
    {
        if ($class instanceof \rhoone\extension\Extension) {
            $class = $class->className();
        }
        if ($class instanceof \rhoone\models\Extension) {
            $class = $class->classname;
        }
        if (!is_string($class)) {
            Yii::error('the class name is not a string.', __METHOD__);
            throw new InvalidParamException('the class name is not a string. (' . __METHOD__ . ')');
        }
        Yii::trace('validate extension: `' . $class . '`', __METHOD__);

        $class = static::normalizeClass($class);
        $extension = static::validateExtension($class);
        $dic = DictionaryManager::validate($extension);
        return $extension;
    }
public static function validate ( $ class ) { if ( $ class instanceof \ rhoone \ extension \ Extension ) { $ class = $ class -> className ( ) ; } if ( $ class instanceof \ rhoone \ models \ Extension ) { $ class = $ class -> classname ; } if ( ! is_string ( $ class ) ) { Yii :: error ( 'the class name is not a string.' , __METHOD__ ) ; throw new InvalidParamException ( 'the class name is not a string. (' . __METHOD__ . ')' ) ; } Yii :: trace ( 'validate extension: `' . $ class . '`' , __METHOD__ ) ; $ class = static :: normalizeClass ( $ class ) ; $ extension = static :: validateExtension ( $ class ) ; $ dic = DictionaryManager :: validate ( $ extension ) ; return $ extension ; }
Validate extension class.
@param string|\rhoone\extension\Extension|\rhoone\models\Extension $class
`string` if extension class name.
`\rhoone\extension\Extension` if extension instance.
`\rhoone\models\Extension` if extension record.
@return \rhoone\extension\Extension
@throws InvalidParamException
Validate extension class .