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: *
26: * @param string $format
27: * @param string $href
28: */
29: public function __cunstruct($format = null, $href = null)
30: {
31: $this->format = $format;
32: $this->href = $href;
33: }
34:
35: /**
36: * Set format
37: *
38: * @param string $format
39: * @return LegendUrl
40: */
41: public function setFormat($format)
42: {
43: $this->format = $format;
44:
45: return $this;
46: }
47:
48: /**
49: * Get format
50: *
51: * @return string
52: */
53: public function getFormat()
54: {
55: return $this->format;
56: }
57:
58: /**
59: * Set href
60: *
61: * @param string $href
62: * @return LegendUrl
63: */
64: public function setHref($href)
65: {
66: $this->href = $href;
67:
68: return $this;
69: }
70:
71: /**
72: * Get href
73: *
74: * @return string
75: */
76: public function getHref()
77: {
78: return $this->href;
79: }
80:
81: public static function create($format = null, $href = null)
82: {
83: if($href === null)
84: {
85: $olr = null;
86: } else
87: {
88: $olr = new OnlineResource();
89: $olr->setFormat($format);
90: $olr->setHref($href);
91: }
92: return $olr;
93: }
94:
95: }