Your IP : 216.73.216.50


Current Path : /proc/1908984/root/proc/1908984/root/home/digilove/www/41423/
Upload File :
Current File : //proc/1908984/root/proc/1908984/root/home/digilove/www/41423/GeneratorFactory.php.tar

home/digilove/public_html/110/libraries/smartslider3/src/SmartSlider3/Generator/GeneratorFactory.php000064400000002127152413376550027526 0ustar00<?php

namespace Nextend\SmartSlider3\Generator;

use Nextend\Framework\Pattern\PluggableTrait;
use Nextend\Framework\Pattern\SingletonTrait;

class GeneratorFactory {

    use PluggableTrait, SingletonTrait;

    /** @var AbstractGeneratorGroup[] */
    private static $generators = array();

    protected function init() {

        $this->makePluggable('SliderGenerator');
    }

    /**
     * @param AbstractGeneratorGroup $generator
     */
    public static function addGenerator($generator) {
        self::$generators[$generator->getName()] = $generator;
    }

    public static function getGenerators() {
        foreach (self::$generators as $generator) {
            $generator->load();
        }

        return self::$generators;
    }

    /**
     * @param $name
     *
     * @return AbstractGeneratorGroup|false
     */
    public static function getGenerator($name) {
        if (!isset(self::$generators[$name])) {
            return false;
        }

        return self::$generators[$name]->load();
    }
}

GeneratorFactory::getInstance();