-
Notifications
You must be signed in to change notification settings - Fork 42
/
InputScreenAddAllHandler.php
87 lines (77 loc) · 1.92 KB
/
InputScreenAddAllHandler.php
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<?php
/**
* This file is part of MetaModels/core.
*
* (c) 2012-2016 The MetaModels team.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* This project is provided in good faith and hope to be usable by anyone.
*
* @package MetaModels
* @subpackage Core
* @author Christian Schiffler <c.schiffler@cyberspectrum.de>
* @copyright 2012-2016 The MetaModels team.
* @license https://github.com/MetaModels/core/blob/master/LICENSE LGPL-3.0
* @filesource
*/
namespace MetaModels\DcGeneral\Events\Table\InputScreens;
use MetaModels\Attribute\IAttribute;
use MetaModels\DcGeneral\Events\Table\AbstractAddAllHandler;
/**
* This class handles the add all action for render settings.
*/
class InputScreenAddAllHandler extends AbstractAddAllHandler
{
/**
* The table name to work on.
*
* @var string
*/
protected static $table = 'tl_metamodel_dcasetting';
/**
* The parent table name to work on.
*
* @var string
*/
protected static $ptable = 'tl_metamodel_dca';
/**
* The field to use for activating.
*
* @var string
*/
protected static $activeField = 'published';
/**
* The action name to listen on.
*
* @var string
*/
protected static $actionName = 'dca_addall';
/**
* {@inheritDoc}
*
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
protected function createEmptyDataFor($attribute)
{
return array(
'dcatype' => 'attribute',
'tl_class' => '',
);
}
/**
* Test if the passed attribute is acceptable.
*
* @param IAttribute $attribute The attribute to check.
*
* @return bool
*/
protected function accepts($attribute)
{
if (!$attribute->get('id')) {
return false;
}
return true;
}
}