summaryrefslogtreecommitdiff
path: root/www/wiki/extensions/SemanticResultFormats/src/vCard/Address.php
diff options
context:
space:
mode:
Diffstat (limited to 'www/wiki/extensions/SemanticResultFormats/src/vCard/Address.php')
-rw-r--r--www/wiki/extensions/SemanticResultFormats/src/vCard/Address.php21
1 files changed, 20 insertions, 1 deletions
diff --git a/www/wiki/extensions/SemanticResultFormats/src/vCard/Address.php b/www/wiki/extensions/SemanticResultFormats/src/vCard/Address.php
index 3a8d31be..9145bb21 100644
--- a/www/wiki/extensions/SemanticResultFormats/src/vCard/Address.php
+++ b/www/wiki/extensions/SemanticResultFormats/src/vCard/Address.php
@@ -30,12 +30,31 @@ class Address {
* @param string $type
* @param array $adr
*/
- public function __construct( $type, array $adr ) {
+ public function __construct( $type, array $adr = [] ) {
$this->type = $type;
$this->adr = $adr;
}
/**
+ * @since 3.1
+ *
+ * @return boolean
+ */
+ public function hasAddress() {
+ return $this->adr !== [];
+ }
+
+ /**
+ * @since 3.1
+ *
+ * @param string $key
+ * @param string $value
+ */
+ public function set( $key, $value ) {
+ $this->adr[$key] = $value;
+ }
+
+ /**
* @return string
*/
public function text() {