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 / RESOURCEStrait.php

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

130 lines 4.1 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
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 InvalidArgumentException;
36
37 /**
38 * RESOURCES property functions
39 *
40 * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
41 * @since 2.29.14 2019-09-03
42 */
43 trait RESOURCEStrait
44 {
45 /**
46 * @var array component property RESOURCES value
47 */
48 protected $resources = null;
49
50 /**
51 * Return formatted output for calendar component property resources
52 *
53 * @return string
54 * @since 2.29.11 - 2019-08-30
55 */
56 public function createResources()
57 {
58 return self::createCatRes(
59 self::RESOURCES,
60 $this->resources,
61 $this->getConfig( self::LANGUAGE ),
62 $this->getConfig( self::ALLOWEMPTY ),
63 self::$ALTRPLANGARR
64 );
65 }
66
67 /**
68 * Delete calendar component property resources
69 *
70 * @param int $propDelIx specific property in case of multiply occurrence
71 * @return bool
72 * @since 2.27.1 - 2018-12-15
73 */
74 public function deleteResources( $propDelIx = null )
75 {
76 if( empty( $this->resources )) {
77 unset( $this->propDelIx[self::RESOURCES] );
78 return false;
79 }
80 return $this->deletePropertyM( $this->resources, self::RESOURCES, $propDelIx );
81 }
82
83 /**
84 * Get calendar component property resources
85 *
86 * @param int $propIx specific property in case of multiply occurrence
87 * @param bool $inclParam
88 * @return bool|array
89 * @since 2.27.1 - 2018-12-12
90 */
91 public function getResources( $propIx = null, $inclParam = false )
92 {
93 if( empty( $this->resources )) {
94 unset( $this->propIx[self::RESOURCES] );
95 return false;
96 }
97 return $this->getPropertyM(
98 $this->resources,
99 self::RESOURCES,
100 $propIx,
101 $inclParam
102 );
103 }
104
105 /**
106 * Set calendar component property resources
107 *
108 * @param mixed $value
109 * @param array $params
110 * @param integer $index
111 * @return static
112 * @throws InvalidArgumentException
113 * @since 2.29.14 2019-09-03
114 */
115 public function setResources( $value = null, $params = [], $index = null )
116 {
117 if( empty( $value )) {
118 $this->assertEmptyValue( $value, self::RESOURCES );
119 $value = Util::$SP0;
120 $params = [];
121 }
122 else {
123 Util::assertString( $value, self::RESOURCES );
124 $value = StringFactory::trimTrailNL( $value );
125 }
126 $this->setMval( $this->resources, $value, $params, null, $index );
127 return $this;
128 }
129 }
130