1: <?php
2: /**
3: * PHP version 5
4: * @package generalDriver
5: * @author Christian Schiffler <c.schiffler@cyberspectrum.de>
6: * @author Stefan Heimes <stefan_heimes@hotmail.com>
7: * @author Tristan Lins <tristan.lins@bit3.de>
8: * @copyright The MetaModels team.
9: * @license LGPL.
10: * @filesource
11: */
12:
13: namespace DcGeneral\DataDefinition\Palette;
14:
15: use DcGeneral\Data\ModelInterface;
16: use DcGeneral\Data\PropertyValueBag;
17: use DcGeneral\DataDefinition\Palette\Condition\Property\PropertyConditionInterface;
18:
19: /**
20: * A property contained within a palette.
21: *
22: * @package DcGeneral\DataDefinition\Palette
23: */
24: interface PropertyInterface
25: {
26: /**
27: * Set the name of the property.
28: *
29: * @param string $name The name of the property.
30: *
31: * @return PropertyInterface
32: */
33: public function setName($name);
34:
35: /**
36: * Return the name of the property.
37: *
38: * @return string
39: */
40: public function getName();
41:
42: /**
43: * Check the conditions, if this property is visible.
44: *
45: * @param ModelInterface|null $model If given, sub palettes will be evaluated depending on the model.
46: * If no model is given, all properties will be returned, including sub palette
47: * properties.
48: *
49: * @param PropertyValueBag $input If given, sub palettes will be evaluated depending on the input data.
50: * If no model and no input data is given, all properties will be returned,
51: * including sub palette properties.
52: *
53: * @return bool
54: */
55: public function isVisible(ModelInterface $model = null, PropertyValueBag $input = null);
56:
57: /**
58: * Check the conditions, if this property is editable.
59: *
60: * @param ModelInterface|null $model If given, sub palettes will be evaluated depending on the model.
61: * If no model is given, all properties will be returned, including sub palette
62: * properties.
63: *
64: * @param PropertyValueBag $input If given, sub palettes will be evaluated depending on the input data.
65: * If no model and no input data is given, all properties will be returned,
66: * including sub palette properties.
67: *
68: * @return bool
69: */
70: public function isEditable(ModelInterface $model = null, PropertyValueBag $input = null);
71:
72: /**
73: * Set the visible condition for this property.
74: *
75: * @param PropertyConditionInterface $condition The condition.
76: *
77: * @return PropertyInterface
78: */
79: public function setVisibleCondition(PropertyConditionInterface $condition = null);
80:
81: /**
82: * Get the visible condition for this property.
83: *
84: * @return PropertyConditionInterface
85: */
86: public function getVisibleCondition();
87:
88: /**
89: * Set the editable condition for this property.
90: *
91: * @param PropertyConditionInterface $condition The condition.
92: *
93: * @return PropertyInterface
94: */
95: public function setEditableCondition(PropertyConditionInterface $condition = null);
96:
97: /**
98: * Get the editable condition for this property.
99: *
100: * @return PropertyConditionInterface
101: */
102: public function getEditableCondition();
103:
104: /**
105: * Create a deep clone of the property.
106: *
107: * @return void
108: */
109: public function __clone();
110: }
111: