PluginProbe
Import Social Events / 1.8.5
Import Social Events v1.8.5
1.9.1 1.9.0 trunk 1.0.0 1.0.1 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.2.0 1.3.0 1.4.0 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.5.5 1.6.0 1.6.1 1.6.10 1.6.11 1.6.12 All 61 releases
import-facebook-events / includes / lib / icalcreator / src / Traits / TZURLtrait.php

TZURLtrait.php in Import Social Events 1.8.5, at includes/lib/icalcreator/src/Traits/TZURLtrait.php

128 lines 3.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * iCalcreator, the PHP class package managing iCal (rfc2445/rfc5445) calendar information.
4 *
5 * copyright (c) 2007-2021 Kjell-Inge Gustafsson, kigkonsult, All rights reserved
6 * Link https://kigkonsult.se
7 * Package iCalcreator
8 * Version 2.30.2
9 * License Subject matter of licence is the software iCalcreator.
10 * The above copyright, link, package and version notices,
11 * this licence notice and the invariant [rfc5545] PRODID result use
12 * as implemented and invoked in iCalcreator shall be included in
13 * all copies or substantial portions of the iCalcreator.
14 *
15 * iCalcreator is free software: you can redistribute it and/or modify
16 * it under the terms of the GNU Lesser General Public License as published
17 * by the Free Software Foundation, either version 3 of the License,
18 * or (at your option) any later version.
19 *
20 * iCalcreator is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU Lesser General Public License for more details.
24 *
25 * You should have received a copy of the GNU Lesser General Public License
26 * along with iCalcreator. If not, see <https://www.gnu.org/licenses/>.
27 *
28 * This file is a part of iCalcreator.
29 */
30
31 namespace Kigkonsult\Icalcreator\Traits;
32
33 use Kigkonsult\Icalcreator\Util\StringFactory;
34 use Kigkonsult\Icalcreator\Util\Util;
35 use Kigkonsult\Icalcreator\Util\HttpFactory;
36 use Kigkonsult\Icalcreator\Util\ParameterFactory;
37 use InvalidArgumentException;
38
39 /**
40 * TZURL property functions
41 *
42 * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
43 * @since 2.30.2 - 2021-02-04
44 */
45 trait TZURLtrait
46 {
47 /**
48 * @var array component property TZURL value
49 */
50 protected $tzurl = null;
51
52 /**
53 * Return formatted output for calendar component property tzurl
54 *
55 * @return string
56 */
57 public function createTzurl()
58 {
59 if( empty( $this->tzurl )) {
60 return null;
61 }
62 if( empty( $this->tzurl[Util::$LCvalue] )) {
63 return $this->getConfig( self::ALLOWEMPTY )
64 ? StringFactory::createElement( self::TZURL )
65 : null;
66 }
67 return StringFactory::createElement(
68 self::TZURL,
69 ParameterFactory::createParams( $this->tzurl[Util::$LCparams] ),
70 $this->tzurl[Util::$LCvalue]
71 );
72 }
73
74 /**
75 * Delete calendar component property tzurl
76 *
77 * @return bool
78 * @since 2.27.1 - 2018-12-15
79 */
80 public function deleteTzurl()
81 {
82 $this->tzurl = null;
83 return true;
84 }
85
86 /**
87 * Get calendar component property tzurl
88 *
89 * @param bool $inclParam
90 * @return bool|array
91 * @since 2.27.1 - 2018-12-13
92 */
93 public function getTzurl( $inclParam = false )
94 {
95 if( empty( $this->tzurl )) {
96 return false;
97 }
98 return ( $inclParam ) ? $this->tzurl : $this->tzurl[Util::$LCvalue];
99 }
100
101 /**
102 * Set calendar component property tzurl
103 *
104 * Note, "TZURL" values SHOULD NOT be specified as a file URI type.
105 * This URI form can be useful within an organization, but is problematic
106 * in the Internet.
107 *
108 * @param string $value
109 * @param array $params
110 * @return static
111 * @throws InvalidArgumentException
112 * @since 2.30.2 - 2021-02-04
113 */
114 public function setTzurl( $value = null, $params = [] )
115 {
116 if( empty( $value )) {
117 $this->assertEmptyValue( $value, self::TZURL );
118 $this->tzurl = [
119 Util::$LCvalue => Util::$SP0,
120 Util::$LCparams => [],
121 ];
122 return $this;
123 }
124 HttpFactory::urlSet( $this->tzurl, $value, $params );
125 return $this;
126 }
127 }
128