1: <?php
2:
3: namespace Mapbender\WmsBundle\Component;
4:
5: /**
6: * LegendUrl class.
7: * @author Paul Schmidt
8: */
9: class OnlineResource
10: {
11:
12: /**
13: * ORM\Column(type="string", nullable=true)
14: */
15: //@TODO Doctrine bug: "protected" replaced with "public"
16: public $format;
17:
18: /**
19: * ORM\Column(type="string", nullable=true)
20: */
21: //@TODO Doctrine bug: "protected" replaced with "public"
22: public $href;
23:
24: /**
25: * Set format
26: *
27: * @param string $format
28: * @return LegendUrl
29: */
30: public function setFormat($format)
31: {
32: $this->format = $format;
33:
34: return $this;
35: }
36:
37: /**
38: * Get format
39: *
40: * @return string
41: */
42: public function getFormat()
43: {
44: return $this->format;
45: }
46:
47: /**
48: * Set href
49: *
50: * @param string $href
51: * @return LegendUrl
52: */
53: public function setHref($href)
54: {
55: $this->href = $href;
56:
57: return $this;
58: }
59:
60: /**
61: * Get href
62: *
63: * @return string
64: */
65: public function getHref()
66: {
67: return $this->href;
68: }
69:
70: public static function create($format = null, $href = null)
71: {
72: if($href === null)
73: {
74: $olr = null;
75: } else
76: {
77: $olr = new OnlineResource();
78: $olr->setFormat($format);
79: $olr->setHref($href);
80: }
81: return $olr;
82: }
83:
84: }