Class luya\ConfigDefinition

Inheritanceluya\ConfigDefinition
Available since version1.0.21

Contains the defintion of a config element.

Public Methods

Hide inherited methods

Method Description Defined By
__construct() Consturctor luya\ConfigDefinition
consoleRuntime() Set console runtime luya\ConfigDefinition
env() Set env luya\ConfigDefinition
getConfig() Getter method for config luya\ConfigDefinition
getGroup() Getter method for group luya\ConfigDefinition
getKey() Getter method for config key luya\ConfigDefinition
runtime() Set runtime luya\ConfigDefinition
validateEnvs() Validate whether given env exsts or not. luya\ConfigDefinition
validateRuntime() Validate whether its given runtime or not luya\ConfigDefinition
webRuntime() Set web runtime luya\ConfigDefinition

Constants

Hide inherited constants

Constant Value Description Defined By
GROUP_APPLICATIONS 3 luya\ConfigDefinition
GROUP_BOOTSTRAPS 4 luya\ConfigDefinition
GROUP_CALLABLE 5 luya\ConfigDefinition
GROUP_COMPONENTS 1 luya\ConfigDefinition
GROUP_MODULES 2 luya\ConfigDefinition

Method Details

Hide inherited methods

__construct() public method

Consturctor

public void __construct ( $group, $key, $config )
$group string
$key string
$config mixed

                public function __construct($group, $key, $config)
{
    $this->_group = $group;
    $this->_key = $key;
    $this->_config = is_scalar($config) ? ['class' => $config] : $config;
}

            
consoleRuntime() public method

Set console runtime

public static consoleRuntime ( )

                public function consoleRuntime()
{
    $this->_runtime = Config::RUNTIME_CONSOLE;
    return $this;
}

            
env() public method

Set env

public static env ( $env )
$env string

                public function env($env)
{
    $this->_env = $env;
    return $this;
}

            
getConfig() public method

Getter method for config

public array getConfig ( )

                public function getConfig()
{
    return $this->_config;
}

            
getGroup() public method

Getter method for group

public string getGroup ( )

                public function getGroup()
{
    return $this->_group;
}

            
getKey() public method

Getter method for config key

public string getKey ( )

                public function getKey()
{
    return $this->_key;
}

            
runtime() public method

Set runtime

public static runtime ( $runtime )
$runtime string

                public function runtime($runtime)
{
    $this->_runtime = $runtime;
    return $this;
}

            
validateEnvs() public method

Validate whether given env exsts or not.

public boolean validateEnvs ( array $envs )
$envs array

                public function validateEnvs(array $envs)
{
    return in_array($this->_env, $envs);
}

            
validateRuntime() public method

Validate whether its given runtime or not

public boolean validateRuntime ( $runtime )
$runtime string

                public function validateRuntime($runtime)
{
    return $this->_runtime == $runtime;
}

            
webRuntime() public method

Set web runtime

public static webRuntime ( )

                public function webRuntime()
{
    $this->_runtime = Config::RUNTIME_WEB;
    return $this;
}