|
1
|
|
|
<?php |
|
2
|
|
|
/** |
|
3
|
|
|
* ZfTable ( Module for Zend Framework 2) |
|
4
|
|
|
* |
|
5
|
|
|
* @copyright Copyright (c) 2013 Piotr Duda [email protected] |
|
6
|
|
|
* @license MIT License |
|
7
|
|
|
*/ |
|
8
|
|
|
|
|
9
|
|
|
namespace ZfTable\Decorator; |
|
10
|
|
|
|
|
11
|
|
|
use Zend\ServiceManager\AbstractPluginManager; |
|
12
|
|
|
|
|
13
|
|
|
class DecoratorPluginManager extends AbstractPluginManager |
|
14
|
|
|
{ |
|
15
|
|
|
|
|
16
|
|
|
/** |
|
17
|
|
|
* Default set of helpers |
|
18
|
|
|
* |
|
19
|
|
|
* @var array |
|
20
|
|
|
*/ |
|
21
|
|
|
protected $invokableClasses = array( |
|
22
|
|
|
|
|
23
|
|
|
'cellattr' => '\ZfTable\Decorator\Cell\AttrDecorator', |
|
24
|
|
|
'cellvarattr' => '\ZfTable\Decorator\Cell\VarAttrDecorator', |
|
25
|
|
|
'cellclass' => '\ZfTable\Decorator\Cell\ClassDecorator', |
|
26
|
|
|
'cellicon' => '\ZfTable\Decorator\Cell\Icon', |
|
27
|
|
|
'cellmapper' => '\ZfTable\Decorator\Cell\Mapper', |
|
28
|
|
|
'celllink' => '\ZfTable\Decorator\Cell\Link', |
|
29
|
|
|
'celltemplate' => '\ZfTable\Decorator\Cell\Template', |
|
30
|
|
|
'celleditable' => '\ZfTable\Decorator\Cell\Editable', |
|
31
|
|
|
'cellcallable' => '\ZfTable\Decorator\Cell\CallableDecorator', |
|
32
|
|
|
|
|
33
|
|
|
|
|
34
|
|
|
'rowclass' => '\ZfTable\Decorator\Row\ClassDecorator', |
|
35
|
|
|
'rowvarattr' => '\ZfTable\Decorator\Row\VarAttr', |
|
36
|
|
|
'rowseparatable' => '\ZfTable\Decorator\Row\Separatable', |
|
37
|
|
|
); |
|
38
|
|
|
|
|
39
|
|
|
/** |
|
40
|
|
|
* Don't share header by default |
|
41
|
|
|
* |
|
42
|
|
|
* @var bool |
|
43
|
|
|
*/ |
|
44
|
|
|
protected $shareByDefault = false; |
|
45
|
|
|
|
|
46
|
|
|
/** |
|
47
|
|
|
* @param mixed $plugin |
|
48
|
|
|
*/ |
|
49
|
|
|
public function validatePlugin($plugin) |
|
50
|
|
|
{ |
|
51
|
|
|
if ($plugin instanceof AbstractDecorator) { |
|
52
|
|
|
return; |
|
53
|
|
|
} |
|
54
|
|
|
throw new \DomainException('Invalid Decorator Implementation'); |
|
55
|
|
|
} |
|
56
|
|
|
} |
|
57
|
|
|
|