PluginProbe
Import Social Events / 1.8.7
Import Social Events v1.8.7
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 / ATTENDEEtrait.php

ATTENDEEtrait.php in Import Social Events 1.8.7, at includes/lib/icalcreator/src/Traits/ATTENDEEtrait.php

131 lines 4.3 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 InvalidArgumentException;
34 use Kigkonsult\Icalcreator\Util\CalAddressFactory;
35 use Kigkonsult\Icalcreator\Util\Util;
36
37 /**
38 * ATTENDEE property functions
39 *
40 * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
41 * @since 2.27.8 - 2019-03-17
42 */
43 trait ATTENDEEtrait
44 {
45 /**
46 * @var array component property ATTENDEE value
47 */
48 protected $attendee = null;
49
50 /**
51 * Return formatted output for calendar component property attendee
52 *
53 * @return string
54 */
55 public function createAttendee()
56 {
57 if( empty( $this->attendee )) {
58 return null;
59 }
60 return CalAddressFactory::outputFormatAttendee(
61 $this->attendee,
62 $this->getConfig( self::ALLOWEMPTY )
63 );
64 }
65
66 /**
67 * Delete calendar component property attendee
68 *
69 * @param int $propDelIx specific property in case of multiply occurrence
70 * @return bool
71 * @since 2.27.1 - 2018-12-15
72 */
73 public function deleteAttendee( $propDelIx = null )
74 {
75 if( empty( $this->attendee )) {
76 unset( $this->propDelIx[self::ATTENDEE] );
77 return false;
78 }
79 return $this->deletePropertyM( $this->attendee, self::ATTENDEE, $propDelIx );
80 }
81
82 /**
83 * Get calendar component property attendee
84 *
85 * @param int $propIx specific property in case of multiply occurrence
86 * @param bool $inclParam
87 * @return bool|array
88 * @since 2.27.1 - 2018-12-12
89 */
90 public function getAttendee( $propIx = null, $inclParam = false )
91 {
92 if( empty( $this->attendee )) {
93 unset( $this->propIx[self::ATTENDEE] );
94 return false;
95 }
96 return $this->getPropertyM( $this->attendee, self::ATTENDEE, $propIx, $inclParam );
97 }
98
99 /**
100 * Set calendar component property attendee
101 *
102 * @param string $value
103 * @param array $params
104 * @param integer $index
105 * @return static
106 * @throws InvalidArgumentException
107 * @since 2.27.8 - 2019-03-17
108 */
109 public function setAttendee( $value = null, $params = [], $index = null )
110 {
111 if( empty( $value )) {
112 $this->assertEmptyValue( $value, self::ATTENDEE );
113 $value = Util::$SP0;
114 $params = [];
115 }
116 $value = CalAddressFactory::conformCalAddress( $value );
117 if( ! empty( $value )) {
118 CalAddressFactory::assertCalAddress( $value );
119 }
120 $params = array_change_key_case( (array) $params, CASE_UPPER );
121 CalAddressFactory::sameValueAndEMAILparam( $value, $params );
122 $params = CalAddressFactory::inputPrepAttendeeParams(
123 $params,
124 $this->getCompType(),
125 $this->getConfig( self::LANGUAGE )
126 );
127 $this->setMval($this->attendee, $value, $params,null, $index );
128 return $this;
129 }
130 }
131