comparison vendor/sabre/vobject/lib/Property/Boolean.php @ 7:430dbd5346f7

vendor sabre as distributed
author Charlie Root
date Sat, 13 Jan 2018 09:06:10 -0500
parents
children
comparison
equal deleted inserted replaced
6:cec75ba50afc 7:430dbd5346f7
1 <?php
2
3 namespace Sabre\VObject\Property;
4
5 use
6 Sabre\VObject\Property;
7
8 /**
9 * Boolean property
10 *
11 * This object represents BOOLEAN values. These are always the case-insenstive
12 * string TRUE or FALSE.
13 *
14 * Automatic conversion to PHP's true and false are done.
15 *
16 * @copyright Copyright (C) 2011-2015 fruux GmbH (https://fruux.com/).
17 * @author Evert Pot (http://evertpot.com/)
18 * @license http://sabre.io/license/ Modified BSD License
19 */
20 class Boolean extends Property {
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 * @return void
30 */
31 public function setRawMimeDirValue($val) {
32
33 $val = strtoupper($val)==='TRUE'?true:false;
34 $this->setValue($val);
35
36 }
37
38 /**
39 * Returns a raw mime-dir representation of the value.
40 *
41 * @return string
42 */
43 public function getRawMimeDirValue() {
44
45 return $this->value?'TRUE':'FALSE';
46
47 }
48
49 /**
50 * Returns the type of value.
51 *
52 * This corresponds to the VALUE= parameter. Every property also has a
53 * 'default' valueType.
54 *
55 * @return string
56 */
57 public function getValueType() {
58
59 return 'BOOLEAN';
60
61 }
62
63 }