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\Builder\Event;
14:
15: use DcGeneral\DataDefinition\Palette\Builder\PaletteBuilder;
16:
17: /**
18: * This event gets emitted when a legend class name is set.
19: *
20: * @package DcGeneral\DataDefinition\Palette\Builder\Event
21: */
22: class SetLegendClassNameEvent extends BuilderEvent
23: {
24: const NAME = 'dc-general.data-definition.palette.builder.set-legend-class-name';
25:
26: /**
27: * The class name.
28: *
29: * @var string
30: */
31: protected $legendClassName;
32:
33: /**
34: * Create a new instance.
35: *
36: * @param string $legendClassName The class name.
37: *
38: * @param PaletteBuilder $paletteBuilder The palette builder in use.
39: */
40: public function __construct($legendClassName, PaletteBuilder $paletteBuilder)
41: {
42: $this->setLegendClassName($legendClassName);
43: parent::__construct($paletteBuilder);
44: }
45:
46: /**
47: * Set the legend class name.
48: *
49: * @param string $legendClassName The class name.
50: *
51: * @return SetLegendClassNameEvent
52: */
53: public function setLegendClassName($legendClassName)
54: {
55: $this->legendClassName = (string)$legendClassName;
56:
57: return $this;
58: }
59:
60: /**
61: * Retrieve the class name.
62: *
63: * @return string
64: */
65: public function getLegendClassName()
66: {
67: return $this->legendClassName;
68: }
69: }
70: