1: <?php
2:
3: namespace Mapbender\WmsBundle\Component;
4:
5: /**
6: * LegendUrl class.
7: * @author Paul Schmidt
8: */
9: class LegendUrl
10: {
11:
12: /**
13: * ORM\Column(type="string", nullable=true)
14: */
15: //@TODO Doctrine bug: "protected" replaced with "public"
16: public $onlineResource;
17:
18: /**
19: * ORM\Column(type="integer", nullable=true)
20: */
21: //@TODO Doctrine bug: "protected" replaced with "public"
22: public $width;
23:
24: /**
25: * ORM\Column(type="integer", nullable=true)
26: */
27: //@TODO Doctrine bug: "protected" replaced with "public"
28: public $height;
29:
30: /**
31: *
32: * @param OnlineResource $onlineResource onl
33: * @param int $width
34: * @param int $height
35: */
36: public function __construct($onlineResource = null, $width = null, $height = null)
37: {
38: $this->onlineResource = $onlineResource;
39: $this->width = $width;
40: $this->height = $height;
41: }
42:
43: /**
44: * Set onlineResource
45: *
46: * @param OnlineResource $onlineResource
47: * @return LegendUrl
48: */
49: public function setOnlineResource(OnlineResource $onlineResource)
50: {
51: $this->onlineResource = $onlineResource;
52:
53: return $this;
54: }
55:
56: /**
57: * Get onlineResource
58: *
59: * @return OnlineResource
60: */
61: public function getOnlineResource()
62: {
63: return $this->onlineResource;
64: }
65:
66: /**
67: * Set width
68: *
69: * @param integer $width
70: * @return LegendUrl
71: */
72: public function setWidth($width)
73: {
74: $this->width = $width;
75:
76: return $this;
77: }
78:
79: /**
80: * Get width
81: *
82: * @return integer
83: */
84: public function getWidth()
85: {
86: return $this->width;
87: }
88:
89: /**
90: * Set height
91: *
92: * @param integer $height
93: * @return LegendUrl
94: */
95: public function setHeight($height)
96: {
97: $this->height = $height;
98:
99: return $this;
100: }
101:
102: /**
103: * Get height
104: *
105: * @return integer
106: */
107: public function getHeight()
108: {
109: return $this->height;
110: }
111:
112: public static function create($width = null, $height = null,
113: $onlineResource = null)
114: {
115: $onlineResource = $onlineResource === null ? OnlineResource::create() : $onlineResource;
116: if($onlineResource === null)
117: {
118: $lurl = null;
119: } else
120: {
121: $lurl = new LegendUrl();
122: $lurl->setWidth($width);
123: $lurl->setHeight($height);
124: $lurl->setOnlineResource($onlineResource);
125: }
126: return $lurl;
127: }
128:
129: }