WidgetGroupFactory.php
1.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<?php
namespace Nextend\SmartSlider3\Widget;
use Nextend\Framework\Pattern\PluggableTrait;
use Nextend\Framework\Pattern\SingletonTrait;
use Nextend\SmartSlider3\Widget\Group\AbstractWidgetGroup;
use Nextend\SmartSlider3\Widget\Group\Arrow;
use Nextend\SmartSlider3\Widget\Group\Autoplay;
use Nextend\SmartSlider3\Widget\Group\Bar;
use Nextend\SmartSlider3\Widget\Group\Bullet;
use Nextend\SmartSlider3\Widget\Group\Shadow;
use Nextend\SmartSlider3\Widget\Group\Thumbnail;
class WidgetGroupFactory {
use SingletonTrait, PluggableTrait;
/** @var AbstractWidgetGroup[] */
private static $groups = array();
protected function init() {
new Arrow();
new Autoplay();
new Bar();
new Bullet();
new Shadow();
new Thumbnail();
$this->makePluggable('SliderWidgetGroup');
}
/**
* @param AbstractWidgetGroup $group
*/
public static function addGroup($group) {
self::$groups[$group->getName()] = $group;
}
/**
* @return AbstractWidgetGroup[]
*/
public static function getGroups() {
return self::$groups;
}
/**
* @param $name
*
* @return AbstractWidgetGroup
*/
public static function getGroup($name) {
return self::$groups[$name];
}
}
WidgetGroupFactory::getInstance();