src/generators/Generator.php
public static function create($name, array $config = array())
    {
        if (!isset(self::$config->generators[$name])) {
            throw new Exception("Unknown generator '$name'.");
        }

        $generator = \Yii::createComponent(\CMap::mergeArray(self::$config->generators[$name], $config));
        $generator->init();

        foreach (self::$config->attributes as $attribute => $value) {
            if (property_exists($generator, $attribute)) {
                $generator->$attribute = $value;
            }
        }

        return $generator;
    }
public static function create($name, array $config = array())
    {
        if (!isset(self::$config->generators[$name])) {
            throw new Exception("Unknown generator '$name'.");
        }

        $generator = \Yii::createComponent(\CMap::mergeArray(self::$config->generators[$name], $config));
        $generator->init();

        foreach (self::$config->attributes as $attribute => $value) {
            if (property_exists($generator, $attribute)) {
                $generator->$attribute = $value;
            }
        }

        return $generator;
    }
public static function create ( $ name , array $ config = array ( ) ) { if ( ! isset ( self :: $ config -> generators [ $ name ] ) ) { throw new Exception ( "Unknown generator '$name'." ) ; } $ generator = \ Yii :: createComponent ( \ CMap :: mergeArray ( self :: $ config -> generators [ $ name ] , $ config ) ) ; $ generator -> init ( ) ; foreach ( self :: $ config -> attributes as $ attribute => $ value ) { if ( property_exists ( $ generator , $ attribute ) ) { $ generator -> $ attribute = $ value ; } } return $ generator ; }
Creates a new generator.

@param string $name name of the generator.
@param array $config generator configuration.
@return Generator the created generator.
@throws Exception if the generator is not found.
Creates a new generator .