1 | <?php |
||
47 | abstract class AbstractRelation implements RelationInterface |
||
48 | { |
||
49 | /** |
||
50 | * Relation type |
||
51 | * |
||
52 | * @var string |
||
53 | */ |
||
54 | const TYPE = 'abstract'; |
||
55 | /** |
||
56 | * Relation URL |
||
57 | * |
||
58 | * @var Url |
||
59 | */ |
||
60 | protected $url = null; |
||
61 | /** |
||
62 | * Relation label |
||
63 | * |
||
64 | * @var string |
||
65 | */ |
||
66 | protected $label = null; |
||
67 | /** |
||
68 | * Relation email |
||
69 | * |
||
70 | * @var string |
||
71 | */ |
||
72 | protected $email = null; |
||
73 | /** |
||
74 | * Coupling |
||
75 | * |
||
76 | * @var int |
||
77 | */ |
||
78 | protected $coupling = self::LOOSE_COUPLING; |
||
79 | |||
80 | /** |
||
81 | * @param Url $url Relation URL |
||
82 | * @param string $label Relation label |
||
83 | * @param string $email Relation email |
||
84 | * @param int $coupling Coupling |
||
85 | * @throws OutOfBoundsException If the object coupling is invalid |
||
86 | */ |
||
87 | 18 | public function __construct( |
|
106 | |||
107 | /** |
||
108 | * Return the relation type |
||
109 | * |
||
110 | * @return string Relation type |
||
111 | */ |
||
112 | 18 | public function getType() |
|
116 | |||
117 | /** |
||
118 | * Return the URL |
||
119 | * |
||
120 | * @return Url URL |
||
121 | */ |
||
122 | public function getUrl() |
||
126 | |||
127 | /** |
||
128 | * Set the URL |
||
129 | * |
||
130 | * @param Url|null $url URL |
||
131 | * @return RelationInterface Self reference |
||
132 | */ |
||
133 | public function setUrl(Url $url = null) |
||
139 | |||
140 | /** |
||
141 | * Return the label |
||
142 | * |
||
143 | * @return string|null Label |
||
144 | */ |
||
145 | public function getLabel() |
||
149 | |||
150 | /** |
||
151 | * Set the label |
||
152 | * |
||
153 | * @param string|null $label Label |
||
154 | * @return RelationInterface Self reference |
||
155 | */ |
||
156 | public function setLabel($label) |
||
162 | |||
163 | /** |
||
164 | * Return the email address |
||
165 | * |
||
166 | * @return string|null Email address |
||
167 | */ |
||
168 | public function getEmail() |
||
172 | |||
173 | /** |
||
174 | * Set the email address |
||
175 | * |
||
176 | * @param string|null $email Email address |
||
177 | * @return RelationInterface Self reference |
||
178 | */ |
||
179 | public function setEmail($email) |
||
185 | |||
186 | /** |
||
187 | * Return the coupling |
||
188 | * |
||
189 | * @return int Coupling |
||
190 | */ |
||
191 | public function getCoupling() |
||
195 | |||
196 | /** |
||
197 | * Set the coupling |
||
198 | * |
||
199 | * @param int $coupling Coupling |
||
200 | * @return RelationInterface Self reference |
||
201 | * @throws OutOfBoundsException If the object coupling is invalid |
||
202 | */ |
||
203 | public function setCoupling($coupling) |
||
217 | |||
218 | /** |
||
219 | * Return the unique relation signature |
||
220 | * |
||
221 | * @return string Relation signature |
||
222 | */ |
||
223 | 18 | public function getSignature() |
|
231 | |||
232 | /** |
||
233 | * Serialize the property |
||
234 | * |
||
235 | * @return mixed Property serialization |
||
236 | */ |
||
237 | 4 | public function __toString() |
|
242 | } |
||
243 |