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:
18: /**
19: * Contains multiple palettes, organised by its name.
20: */
21: interface PaletteCollectionInterface
22: {
23: /**
24: * Remove all palettes from this collection.
25: *
26: * @return PaletteCollectionInterface
27: */
28: public function clearPalettes();
29:
30: /**
31: * Set all palettes in this collection.
32: *
33: * @param array|PaletteInterface[] $palettes The palettes.
34: *
35: * @return PaletteCollectionInterface
36: */
37: public function setPalettes(array $palettes);
38:
39: /**
40: * Add multiple palettes to this collection.
41: *
42: * @param array|PaletteInterface[] $palettes The palettes.
43: *
44: * @return PaletteInterface
45: */
46: public function addPalettes(array $palettes);
47:
48: /**
49: * Add a palette to this collection.
50: *
51: * @param PaletteInterface $palette The palette.
52: *
53: * @return PaletteInterface
54: */
55: public function addPalette(PaletteInterface $palette);
56:
57: /**
58: * Remove a palette from this collection.
59: *
60: * @param PaletteInterface $palette The palette.
61: *
62: * @return PaletteInterface
63: */
64: public function removePalette(PaletteInterface $palette);
65:
66: /**
67: * Return all palettes in this collection.
68: *
69: * @return array|PaletteInterface[]
70: */
71: public function getPalettes();
72:
73: /**
74: * Check if a palette exists in this collection.
75: *
76: * @param PaletteInterface $palette The palette.
77: *
78: * @return bool
79: */
80: public function hasPalette(PaletteInterface $palette);
81:
82: /**
83: * Find the palette matching model and input parameters.
84: *
85: * @param ModelInterface|null $model If given, selectors will be evaluated depending on the model.
86: *
87: * @param PropertyValueBag $input If given, selectors will be evaluated depending on the input data.
88: *
89: * @return PaletteInterface
90: */
91: public function findPalette(ModelInterface $model = null, PropertyValueBag $input = null);
92:
93: /**
94: * Check if a palette for the given name exists in this collection.
95: *
96: * @param string $paletteName The palette name.
97: *
98: * @return bool
99: *
100: * @deprecated Only for backwards compatibility, we will remove palette names in the future!
101: */
102: public function hasPaletteByName($paletteName);
103:
104: /**
105: * Return the palette for the given name.
106: *
107: * @param string $paletteName The palette name.
108: *
109: * @return PaletteInterface
110: *
111: * @deprecated Only for backwards compatibility, we will remove palette names in the future!
112: */
113: public function getPaletteByName($paletteName);
114:
115: /**
116: * Create a deep clone of the palette collection.
117: *
118: * @return void
119: */
120: public function __clone();
121: }
122: