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