. * * This file is a part of iCalcreator. */ namespace Kigkonsult\Icalcreator\Traits; use Kigkonsult\Icalcreator\Util\Util; use Kigkonsult\Icalcreator\Util\UtilAttendee; /** * ATTENDEE property functions * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.22.23 - 2017-02-17 */ trait ATTENDEEtrait { /** * @var array component property ATTENDEE value * @access protected */ protected $attendee = null; /** * Return formatted output for calendar component property attendee * * @return string */ public function createAttendee() { if( empty( $this->attendee )) { return null; } return UtilAttendee::formatAttendee( $this->attendee, $this->getConfig( Util::$ALLOWEMPTY )); } /** * Set calendar component property attach * * @param string $value * @param array $params * @param integer $index * @return bool */ public function setAttendee( $value, $params = null, $index = null ) { if( empty( $value )) { if( $this->getConfig( Util::$ALLOWEMPTY )) { $value = Util::$SP0; } else { return false; } } Util::setMval( $this->attendee, UtilAttendee::calAddressCheck( $value, false ), UtilAttendee::prepAttendeeParams( $params, $this->compType, $this->getConfig( Util::$LANGUAGE )), false, $index ); return true; } }