| @@ 21-66 (lines=46) @@ | ||
| 18 | * Class Description |
|
| 19 | * Alows new line charectars to be in the description. |
|
| 20 | */ |
|
| 21 | class Description implements ValueInterface |
|
| 22 | { |
|
| 23 | /** |
|
| 24 | * The value. |
|
| 25 | * |
|
| 26 | * @var string |
|
| 27 | */ |
|
| 28 | protected $value; |
|
| 29 | ||
| 30 | public function __construct($value) |
|
| 31 | { |
|
| 32 | $this->value = $value; |
|
| 33 | } |
|
| 34 | ||
| 35 | /** |
|
| 36 | * Return the value of the Property as an escaped string. |
|
| 37 | * |
|
| 38 | * Escape values as per RFC 2445. See http://www.kanzaki.com/docs/ical/text.html |
|
| 39 | * |
|
| 40 | * @return string |
|
| 41 | */ |
|
| 42 | public function getEscapedValue() |
|
| 43 | { |
|
| 44 | return PropertyValueUtil::escapeValue((string) $this->value); |
|
| 45 | } |
|
| 46 | ||
| 47 | /** |
|
| 48 | * @param string $value |
|
| 49 | * |
|
| 50 | * @return $this |
|
| 51 | */ |
|
| 52 | public function setValue($value) |
|
| 53 | { |
|
| 54 | $this->value = $value; |
|
| 55 | ||
| 56 | return $this; |
|
| 57 | } |
|
| 58 | ||
| 59 | /** |
|
| 60 | * @return string |
|
| 61 | */ |
|
| 62 | public function getValue() |
|
| 63 | { |
|
| 64 | return $this->value; |
|
| 65 | } |
|
| 66 | } |
|
| 67 | ||
| @@ 16-61 (lines=46) @@ | ||
| 13 | ||
| 14 | use Eluceo\iCal\Util\PropertyValueUtil; |
|
| 15 | ||
| 16 | class StringValue implements ValueInterface |
|
| 17 | { |
|
| 18 | /** |
|
| 19 | * The value. |
|
| 20 | * |
|
| 21 | * @var string |
|
| 22 | */ |
|
| 23 | protected $value; |
|
| 24 | ||
| 25 | public function __construct($value) |
|
| 26 | { |
|
| 27 | $this->value = $value; |
|
| 28 | } |
|
| 29 | ||
| 30 | /** |
|
| 31 | * Return the value of the Property as an escaped string. |
|
| 32 | * |
|
| 33 | * Escape values as per RFC 2445. See http://www.kanzaki.com/docs/ical/text.html |
|
| 34 | * |
|
| 35 | * @return string |
|
| 36 | */ |
|
| 37 | public function getEscapedValue() |
|
| 38 | { |
|
| 39 | return PropertyValueUtil::escapeValue((string) $this->value); |
|
| 40 | } |
|
| 41 | ||
| 42 | /** |
|
| 43 | * @param string $value |
|
| 44 | * |
|
| 45 | * @return $this |
|
| 46 | */ |
|
| 47 | public function setValue($value) |
|
| 48 | { |
|
| 49 | $this->value = $value; |
|
| 50 | ||
| 51 | return $this; |
|
| 52 | } |
|
| 53 | ||
| 54 | /** |
|
| 55 | * @return string |
|
| 56 | */ |
|
| 57 | public function getValue() |
|
| 58 | { |
|
| 59 | return $this->value; |
|
| 60 | } |
|
| 61 | } |
|
| 62 | ||