public static function set($actionName, $modelType) {
        if (empty($actionName)) {
            throw new \Exception('$actionName must not be empty.');
        }

        if (empty($modelType)) {
            throw new \Exception('$modelType must not be empty.');
        }

        $canUse = false;

        if ($actionName !== '.') {
            if (!is_array($actionName)) {
                $actionName = array($actionName);
            }

            foreach ($actionName as $action) {
                if (self::$actionContext->actionNameEquals($action)) {
                    $canUse = true;
                    break;
                }
            }
        }
        else {
            $canUse = true;
        }

        if (!$canUse) {
            return;
        }

        if (is_object($modelType)) {
            $modelType = get_class($modelType);
        }

        self::$modelType = $modelType;
    }
public static function set($actionName, $modelType) {
        if (empty($actionName)) {
            throw new \Exception('$actionName must not be empty.');
        }

        if (empty($modelType)) {
            throw new \Exception('$modelType must not be empty.');
        }

        $canUse = false;

        if ($actionName !== '.') {
            if (!is_array($actionName)) {
                $actionName = array($actionName);
            }

            foreach ($actionName as $action) {
                if (self::$actionContext->actionNameEquals($action)) {
                    $canUse = true;
                    break;
                }
            }
        }
        else {
            $canUse = true;
        }

        if (!$canUse) {
            return;
        }

        if (is_object($modelType)) {
            $modelType = get_class($modelType);
        }

        self::$modelType = $modelType;
    }
public static function set ( $ actionName , $ modelType ) { if ( empty ( $ actionName ) ) { throw new \ Exception ( '$actionName must not be empty.' ) ; } if ( empty ( $ modelType ) ) { throw new \ Exception ( '$modelType must not be empty.' ) ; } $ canUse = false ; if ( $ actionName !== '.' ) { if ( ! is_array ( $ actionName ) ) { $ actionName = array ( $ actionName ) ; } foreach ( $ actionName as $ action ) { if ( self :: $ actionContext -> actionNameEquals ( $ action ) ) { $ canUse = true ; break ; } } } else { $ canUse = true ; } if ( ! $ canUse ) { return ; } if ( is_object ( $ modelType ) ) { $ modelType = get_class ( $ modelType ) ; } self :: $ modelType = $ modelType ; }
Specifies the model type for the action.

@param string|string[] $actionName The action name.
@param string|object $modelType The type name of model.

@return void
Specifies the model type for the action .