Mark V
1: <?php
2: namespace MOC\V\Component\Document\Component\Parameter\Repository;
3:
4: use MOC\V\Component\Document\Component\Exception\ComponentException;
5: use MOC\V\Component\Document\Component\IBridgeInterface;
6: use MOC\V\Component\Document\Component\IParameterInterface;
7: use MOC\V\Component\Document\Component\Parameter\Parameter;
8:
9: /**
10: * Class PaperSizeParameter
11: *
12: * @package MOC\V\Component\Document\Component\Parameter\Repository
13: */
14: class PaperSizeParameter extends Parameter implements IParameterInterface
15: {
16:
17: /** @var string $Size */
18: private $Size = null;
19:
20: /**
21: * @param string $Size
22: */
23: public function __construct($Size = 'A4')
24: {
25:
26: $this->setSize($Size);
27: }
28:
29: /**
30: * @return string
31: */
32: public function __toString()
33: {
34:
35: return $this->getSize();
36: }
37:
38: /**
39: * @return string
40: */
41: public function getSize()
42: {
43:
44: return $this->Size;
45: }
46:
47: /**
48: * @param string $Size
49: *
50: * @return IBridgeInterface
51: * @throws ComponentException
52: */
53: public function setSize($Size)
54: {
55:
56: switch ($Size) {
57: case 'A4': {
58: $this->Size = $Size;
59: return $this;
60: }
61: default:
62: throw new ComponentException('Size '.$Size.' not supported');
63: }
64:
65: }
66: }
67: