diff options
author | Robin Appelman <icewind1991@gmail.com> | 2011-09-29 14:28:57 +0200 |
---|---|---|
committer | Robin Appelman <icewind1991@gmail.com> | 2011-09-29 14:28:57 +0200 |
commit | 2086bc4be77ba64337b721cec1cac544c1c58452 (patch) | |
tree | 1ce50e6854664b8e8dcf2b741551cd417de88fdd /3rdparty/Sabre/VObject/Property.php | |
parent | fcc6d61fe195e090da33f213312d3d8bec8c1c71 (diff) | |
download | nextcloud-server-2086bc4be77ba64337b721cec1cac544c1c58452.tar.gz nextcloud-server-2086bc4be77ba64337b721cec1cac544c1c58452.zip |
update sabredav to 1.5.3
Diffstat (limited to '3rdparty/Sabre/VObject/Property.php')
-rw-r--r-- | 3rdparty/Sabre/VObject/Property.php | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/3rdparty/Sabre/VObject/Property.php b/3rdparty/Sabre/VObject/Property.php index 201e6356ad6..624dd4b8a58 100644 --- a/3rdparty/Sabre/VObject/Property.php +++ b/3rdparty/Sabre/VObject/Property.php @@ -128,6 +128,44 @@ class Sabre_VObject_Property extends Sabre_VObject_Element { } + /** + * Adds a new componenten or element + * + * You can call this method with the following syntaxes: + * + * add(Sabre_VObject_Parameter $element) + * add(string $name, $value) + * + * The first version adds an Parameter + * The second adds a property as a string. + * + * @param mixed $item + * @param mixed $itemValue + * @return void + */ + public function add($item, $itemValue = null) { + + if ($item instanceof Sabre_VObject_Parameter) { + if (!is_null($itemValue)) { + throw new InvalidArgumentException('The second argument must not be specified, when passing a VObject'); + } + $this->parameters[] = $item; + } elseif(is_string($item)) { + + if (!is_scalar($itemValue)) { + throw new InvalidArgumentException('The second argument must be scalar'); + } + $this->parameters[] = new Sabre_VObject_Parameter($item,$itemValue); + + } else { + + throw new InvalidArgumentException('The first argument must either be a Sabre_VObject_Element or a string'); + + } + + } + + /* ArrayAccess interface {{{ */ /** |