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: * Set onlineResource
32: *
33: * @param OnlineResource $onlineResource
34: * @return LegendUrl
35: */
36: public function setOnlineResource(OnlineResource $onlineResource)
37: {
38: $this->onlineResource = $onlineResource;
39:
40: return $this;
41: }
42:
43: /**
44: * Get onlineResource
45: *
46: * @return OnlineResource
47: */
48: public function getOnlineResource()
49: {
50: return $this->onlineResource;
51: }
52:
53: /**
54: * Set width
55: *
56: * @param integer $width
57: * @return LegendUrl
58: */
59: public function setWidth($width)
60: {
61: $this->width = $width;
62:
63: return $this;
64: }
65:
66: /**
67: * Get width
68: *
69: * @return integer
70: */
71: public function getWidth()
72: {
73: return $this->width;
74: }
75:
76: /**
77: * Set height
78: *
79: * @param integer $height
80: * @return LegendUrl
81: */
82: public function setHeight($height)
83: {
84: $this->height = $height;
85:
86: return $this;
87: }
88:
89: /**
90: * Get height
91: *
92: * @return integer
93: */
94: public function getHeight()
95: {
96: return $this->height;
97: }
98:
99: public static function create($width = null, $height = null,
100: $onlineResource = null)
101: {
102: $onlineResource = $onlineResource === null ? OnlineResource::create() : $onlineResource;
103: if($onlineResource === null)
104: {
105: $lurl = null;
106: } else
107: {
108: $lurl = new LegendUrl();
109: $lurl->setWidth($width);
110: $lurl->setHeight($height);
111: $lurl->setOnlineResource($onlineResource);
112: }
113: return $lurl;
114: }
115:
116: }