PluginProbe
Import Social Events / 1.9.0
Import Social Events v1.9.0
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 / Vfreebusy.php

Vfreebusy.php in Import Social Events 1.9.0, at includes/lib/icalcreator/src/Vfreebusy.php

128 lines 4.0 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;
32
33 use Exception;
34
35 use function sprintf;
36 use function strtoupper;
37
38 /**
39 * iCalcreator VFREEBUSY component class
40 *
41 * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
42 * @since 2.29.9 2019-08-05
43 */
44 final class Vfreebusy extends Vcomponent
45 {
46 use Traits\ATTENDEEtrait,
47 Traits\COMMENTtrait,
48 Traits\CONTACTtrait,
49 Traits\DTENDtrait,
50 Traits\DTSTAMPtrait,
51 Traits\DTSTARTtrait,
52 Traits\DURATIONtrait, // Deprecated in rfc5545
53 Traits\FREEBUSYtrait,
54 Traits\ORGANIZERtrait,
55 Traits\REQUEST_STATUStrait,
56 Traits\UIDrfc7986trait,
57 Traits\URLtrait;
58
59 /**
60 * @var string
61 */
62 protected static $compSgn = 'f';
63
64 /**
65 * Destructor
66 *
67 * @since 2.26 - 2018-11-10
68 */
69 public function __destruct()
70 {
71 unset(
72 $this->compType,
73 $this->xprop,
74 $this->components,
75 $this->unparsed,
76 $this->config,
77 $this->propIx,
78 $this->compix,
79 $this->propDelIx
80 );
81 unset(
82 $this->cno,
83 $this->srtk
84 );
85 unset(
86 $this->attendee,
87 $this->comment,
88 $this->contact,
89 $this->dtend,
90 $this->dtstamp,
91 $this->dtstart,
92 $this->duration,
93 $this->freebusy,
94 $this->organizer,
95 $this->requeststatus,
96 $this->uid,
97 $this->url
98 );
99 }
100
101 /**
102 * Return formatted output for calendar component VFREEBUSY object instance
103 *
104 * @return string
105 * @throws Exception (on Duration/Freebusy err)
106 * @since 2.29.9 2019-08-05
107 */
108 public function createComponent()
109 {
110 $compType = strtoupper( $this->getCompType());
111 $component = sprintf( self::$FMTBEGIN, $compType );
112 $component .= $this->createUid();
113 $component .= $this->createDtstamp();
114 $component .= $this->createAttendee();
115 $component .= $this->createComment();
116 $component .= $this->createContact();
117 $component .= $this->createDtstart();
118 $component .= $this->createDtend();
119 $component .= $this->createDuration();
120 $component .= $this->createFreebusy();
121 $component .= $this->createOrganizer();
122 $component .= $this->createRequeststatus();
123 $component .= $this->createUrl();
124 $component .= $this->createXprop();
125 return $component . sprintf( self::$FMTEND, $compType );
126 }
127 }
128