1: <?php
2:
3: namespace Mapbender\CoreBundle\Entity;
4:
5: use Doctrine\Common\Collections\ArrayCollection;
6: use Doctrine\ORM\EntityManager;
7: use Doctrine\ORM\Mapping as ORM;
8:
9: /**
10: * Source entity
11: *
12: * @author Paul Schmidt
13: *
14: * @ORM\Entity
15: * @ORM\Table(name="mb_core_source")
16: * @ORM\InheritanceType("JOINED")
17: * @ORM\DiscriminatorColumn(name="discr", type="string")
18: * ORM\DiscriminatorMap({"mb_core_source" = "Source"})
19: */
20: abstract class Source
21: {
22:
23: /**
24: * @var integer $id
25: * @ORM\Id
26: * @ORM\Column(type="integer")
27: * @ORM\GeneratedValue(strategy="AUTO")
28: */
29: protected $id;
30:
31: /**
32: * @var string $title The source title
33: * @ORM\Column(type="string", nullable=true)
34: */
35: protected $title;
36:
37: /**
38: * @var string $alias The source alias
39: * @ORM\Column(type="string", length=128, nullable=true)
40: */
41: protected $alias = "";
42:
43: /**
44: * @var string $description The source description
45: * @ORM\Column(type="text", nullable=true)
46: */
47: protected $description;
48:
49: /**
50: * Get id
51: *
52: * @return integer
53: */
54: public function getId()
55: {
56: return $this->id;
57: }
58:
59: /**
60: * Set title
61: *
62: * @param string $title
63: * @return Source
64: */
65: public function setTitle($title)
66: {
67: $this->title = $title;
68: return $this;
69: }
70:
71: /**
72: * Get title
73: *
74: * @return string
75: */
76: public function getTitle()
77: {
78: return $this->title;
79: }
80:
81: /**
82: * Set description
83: *
84: * @param string $description
85: * @return Source
86: */
87: public function setDescription($description)
88: {
89: $this->description = $description;
90: return $this;
91: }
92:
93: /**
94: * Get description
95: *
96: * @return string
97: */
98: public function getDescription()
99: {
100: return $this->description;
101: }
102:
103: /**
104: * Set alias
105: *
106: * @param string $alias
107: * @return Source
108: */
109: public function setAlias($alias)
110: {
111: $this->alias = $alias;
112: return $this;
113: }
114:
115: /**
116: * Get alias
117: *
118: * @return string
119: */
120: public function getAlias()
121: {
122: return $this->alias;
123: }
124:
125: /**
126: * Get full class name
127: *
128: * @return string
129: */
130: public function getClassname()
131: {
132: return get_class();
133: }
134:
135: /**
136: * Returns a Source as String
137: *
138: * @return String Source as String
139: */
140: public function __toString()
141: {
142: return (string) $this->id;
143: }
144:
145: /**
146: * Returns a source type
147: *
148: * @return String type
149: */
150: public abstract function getType();
151:
152: /**
153: * Returns a manager type
154: *
155: * @return String a manager type
156: */
157: public abstract function getManagertype();
158:
159: /**
160: * Creates a SourceInstance
161: */
162: public abstract function createInstance();
163:
164: /**
165: * Remove a source from a database
166: */
167: public abstract function remove(EntityManager $em);
168: }
169: