. * * This file is a part of iCalcreator. */ namespace Kigkonsult\Icalcreator\Traits; use Kigkonsult\Icalcreator\Util\Util; /** * LOCATION property functions * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.22.23 - 2017-02-17 */ trait LOCATIONtrait { /** * @var array component property LOCATION value * @access protected */ protected $location = null; /** * Return formatted output for calendar component property location * * @return string */ public function createLocation() { if( empty( $this->location )) { return null; } if( empty( $this->location[Util::$LCvalue] )) { return ( $this->getConfig( Util::$ALLOWEMPTY )) ? Util::createElement( Util::$LOCATION ) : null; } return Util::createElement( Util::$LOCATION, Util::createParams( $this->location[Util::$LCparams], Util::$ALTRPLANGARR, $this->getConfig( Util::$LANGUAGE ) ), Util::strrep( $this->location[Util::$LCvalue] ) ); } /** * Set calendar component property location * * @param string $value * @param array $params * @return bool */ public function setLocation( $value, $params = null ) { if( empty( $value )) { if( $this->getConfig( Util::$ALLOWEMPTY )) { $value = Util::$SP0; } else { return false; } } $this->location = [ Util::$LCvalue => Util::trimTrailNL( $value ), Util::$LCparams => Util::setParams( $params ), ]; return true; } }