. * * This file is a part of iCalcreator. */ namespace Kigkonsult\Icalcreator; use Exception; use function sprintf; use function strtoupper; /** * iCalcreator (Vtimezone) Daylight/Standard base component class * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.29.11 - 2019-08-30 */ abstract class DScomponent extends CalendarComponent { use Traits\COMMENTtrait, Traits\DTSTARTtrait, Traits\RDATEtrait, Traits\RRULEtrait, Traits\TZNAMEtrait, Traits\TZOFFSETFROMtrait, Traits\TZOFFSETTOtrait; /** * @var string * @access protected * @static */ protected static $compSgn = 'ds'; /** * Destructor * * @since 2.29.11 - 2019-08-30 */ public function __destruct() { unset( $this->compType, $this->xprop, $this->components, $this->unparsed, $this->config, $this->propIx, $this->compix, $this->propDelIx ); unset( $this->cno, $this->srtk ); unset( $this->comment, $this->dtstart, $this->rdate, $this->rrule, $this->tzname, $this->tzoffsetfrom, $this->tzoffsetto ); } /** * Return formatted output for calendar component VTIMEZONE Daylight/Standard object instances * * @return string * @throws Exception (on Rdate err) * @since 2.29.11 - 2019-08-30 */ public function createComponent() { $compType = strtoupper( $this->getCompType()); $component = sprintf( self::$FMTBEGIN, $compType ); $component .= $this->createTzname(); $component .= $this->createDtstart(); $component .= $this->createTzoffsetfrom(); $component .= $this->createTzoffsetto(); $component .= $this->createRdate(); $component .= $this->createRrule(); $component .= $this->createComment(); $component .= $this->createXprop(); return $component . sprintf( self::$FMTEND, $compType ); } }