@@ -3,7 +3,7 @@ discard block |
||
| 3 | 3 | namespace Sabre\VObject\Property; |
| 4 | 4 | |
| 5 | 5 | use |
| 6 | - Sabre\VObject\Property; |
|
| 6 | + Sabre\VObject\Property; |
|
| 7 | 7 | |
| 8 | 8 | /** |
| 9 | 9 | * Boolean property. |
@@ -19,66 +19,66 @@ discard block |
||
| 19 | 19 | */ |
| 20 | 20 | class Boolean extends Property { |
| 21 | 21 | |
| 22 | - /** |
|
| 23 | - * Sets a raw value coming from a mimedir (iCalendar/vCard) file. |
|
| 24 | - * |
|
| 25 | - * This has been 'unfolded', so only 1 line will be passed. Unescaping is |
|
| 26 | - * not yet done, but parameters are not included. |
|
| 27 | - * |
|
| 28 | - * @param string $val |
|
| 29 | - * |
|
| 30 | - * @return void |
|
| 31 | - */ |
|
| 32 | - function setRawMimeDirValue($val) { |
|
| 33 | - |
|
| 34 | - $val = strtoupper($val) === 'TRUE' ? true : false; |
|
| 35 | - $this->setValue($val); |
|
| 36 | - |
|
| 37 | - } |
|
| 38 | - |
|
| 39 | - /** |
|
| 40 | - * Returns a raw mime-dir representation of the value. |
|
| 41 | - * |
|
| 42 | - * @return string |
|
| 43 | - */ |
|
| 44 | - function getRawMimeDirValue() { |
|
| 45 | - |
|
| 46 | - return $this->value ? 'TRUE' : 'false'; |
|
| 47 | - |
|
| 48 | - } |
|
| 49 | - |
|
| 50 | - /** |
|
| 51 | - * Returns the type of value. |
|
| 52 | - * |
|
| 53 | - * This corresponds to the VALUE= parameter. Every property also has a |
|
| 54 | - * 'default' valueType. |
|
| 55 | - * |
|
| 56 | - * @return string |
|
| 57 | - */ |
|
| 58 | - function getValueType() { |
|
| 59 | - |
|
| 60 | - return 'BOOLEAN'; |
|
| 61 | - |
|
| 62 | - } |
|
| 63 | - |
|
| 64 | - /** |
|
| 65 | - * Hydrate data from a XML subtree, as it would appear in a xCard or xCal |
|
| 66 | - * object. |
|
| 67 | - * |
|
| 68 | - * @param array $value |
|
| 69 | - * |
|
| 70 | - * @return void |
|
| 71 | - */ |
|
| 72 | - function setXmlValue(array $value) { |
|
| 73 | - |
|
| 74 | - $value = array_map( |
|
| 75 | - function($value) { |
|
| 76 | - return 'true' === $value; |
|
| 77 | - }, |
|
| 78 | - $value |
|
| 79 | - ); |
|
| 80 | - parent::setXmlValue($value); |
|
| 81 | - |
|
| 82 | - } |
|
| 22 | + /** |
|
| 23 | + * Sets a raw value coming from a mimedir (iCalendar/vCard) file. |
|
| 24 | + * |
|
| 25 | + * This has been 'unfolded', so only 1 line will be passed. Unescaping is |
|
| 26 | + * not yet done, but parameters are not included. |
|
| 27 | + * |
|
| 28 | + * @param string $val |
|
| 29 | + * |
|
| 30 | + * @return void |
|
| 31 | + */ |
|
| 32 | + function setRawMimeDirValue($val) { |
|
| 33 | + |
|
| 34 | + $val = strtoupper($val) === 'TRUE' ? true : false; |
|
| 35 | + $this->setValue($val); |
|
| 36 | + |
|
| 37 | + } |
|
| 38 | + |
|
| 39 | + /** |
|
| 40 | + * Returns a raw mime-dir representation of the value. |
|
| 41 | + * |
|
| 42 | + * @return string |
|
| 43 | + */ |
|
| 44 | + function getRawMimeDirValue() { |
|
| 45 | + |
|
| 46 | + return $this->value ? 'TRUE' : 'false'; |
|
| 47 | + |
|
| 48 | + } |
|
| 49 | + |
|
| 50 | + /** |
|
| 51 | + * Returns the type of value. |
|
| 52 | + * |
|
| 53 | + * This corresponds to the VALUE= parameter. Every property also has a |
|
| 54 | + * 'default' valueType. |
|
| 55 | + * |
|
| 56 | + * @return string |
|
| 57 | + */ |
|
| 58 | + function getValueType() { |
|
| 59 | + |
|
| 60 | + return 'BOOLEAN'; |
|
| 61 | + |
|
| 62 | + } |
|
| 63 | + |
|
| 64 | + /** |
|
| 65 | + * Hydrate data from a XML subtree, as it would appear in a xCard or xCal |
|
| 66 | + * object. |
|
| 67 | + * |
|
| 68 | + * @param array $value |
|
| 69 | + * |
|
| 70 | + * @return void |
|
| 71 | + */ |
|
| 72 | + function setXmlValue(array $value) { |
|
| 73 | + |
|
| 74 | + $value = array_map( |
|
| 75 | + function($value) { |
|
| 76 | + return 'true' === $value; |
|
| 77 | + }, |
|
| 78 | + $value |
|
| 79 | + ); |
|
| 80 | + parent::setXmlValue($value); |
|
| 81 | + |
|
| 82 | + } |
|
| 83 | 83 | |
| 84 | 84 | } |