Gdn::factoryInstallDependencyFromConfig PHP Method

factoryInstallDependencyFromConfig() public static method

Installs a dependency to the factory with the settings from a configuration.
public static factoryInstallDependencyFromConfig ( mixed $Config, string $Alias = null )
$Config mixed The configuration of the factory definition. This argument can be of the following types: - string: The configuration will be looked up by calling inline{@link Gdn::Config()} - array: The configuration will be set from the array.
$Alias string The class alias to install into the factory. If omitted then it must be in the configuration. The dependency will be installed from the configuration array depending on the following keys: - Alias: Optional if $Alias is passed as an argument. - PropertyName: Required. - SourceAlias: Required. - Override Optional. All of these values are passed to the corresponding argument in inline{@link Gdn::FactoryInstallDependency()}.
    public static function factoryInstallDependencyFromConfig($Config, $Alias = null)
    {
        if (is_string($Config)) {
            $Config = self::config($Config);
        }
        if (is_null($Alias)) {
            $Alias = $Config['Alias'];
        }
        $PropertyName = $Config['PropertyName'];
        $SourceAlias = $Config['SourceAlias'];
        $Override = val('Override', $Config, true);
        self::factoryInstallDependency($Alias, $PropertyName, $SourceAlias, $Override);
    }