* or the GNU Affero General Public License, version 3:
* iCalcreator is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License
* as published by the Free Software Foundation, either version 3 of
* the License, or (at your option) any later version.
* iCalcreator is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
* You should have received a copy of the GNU Affero General Public
* License along with this program.
* If not, see .
*/
namespace kigkonsult\iCalcreator\traits;
use kigkonsult\iCalcreator\util\util;
/**
* TZURL property functions
*
* @author Kjell-Inge Gustafsson, kigkonsult
* @since 2.22.23 - 2017-02-05
*/
trait TZURLtrait {
/**
* @var array component property TZURL value
* @access protected
*/
protected $tzurl = null;
/**
* Return formatted output for calendar component property tzurl
*
* @return string
*/
public function createTzurl() {
if( empty( $this->tzurl ))
return null;
if( empty( $this->tzurl[util::$LCvalue] ))
return ( $this->getConfig( util::$ALLOWEMPTY )) ? util::createElement( util::$TZURL ) : null;
return util::createElement( util::$TZURL,
util::createParams( $this->tzurl[util::$LCparams] ),
$this->tzurl[util::$LCvalue] );
}
/**
* Set calendar component property tzurl
*
* @param string $value
* @param array $params
* @return bool
*/
public function setTzurl( $value, $params=null ) {
if( empty( $value )) {
if( $this->getConfig( util::$ALLOWEMPTY ))
$value = util::$EMPTYPROPERTY;
else
return false;
}
$this->tzurl = [util::$LCvalue => $value,
util::$LCparams => util::setParams( $params )];
return true;
}
}