Exemplo n.º 1
0
 /**
  * Constructor method for InviteComponent
  *
  * @param string $method
  * @param int    $compNum
  * @param bool   $rsvp
  * @param int    $priority
  * @param string $name
  * @param string $loc
  * @param int    $percentComplete
  * @param string $completed
  * @param bool   $noBlob
  * @param FreeBusyStatus $fba
  * @param FreeBusyStatus $fb
  * @param Transparency $transp
  * @param bool   $isOrg
  * @param string $x_uid
  * @param string $uid
  * @param int    $seq
  * @param int    $date
  * @param string $calItemId
  * @param string $apptId
  * @param string $ciFolder
  * @param InviteStatus $status
  * @param InviteClass $class
  * @param string $url
  * @param bool   $ex
  * @param string $ridZ
  * @param bool   $allDay
  * @param bool   $draft
  * @param bool   $neverSent
  * @param array  $changes
  * @param array  $categories
  * @param array  $comments
  * @param array  $contacts
  * @param GeoInfo $geo for iCalendar GEO property
  * @param array  $attendees
  * @param array  $alarms
  * @param array  $xprops
  * @param string $fr Fragment
  * @param string $desc Description
  * @param string $descHtml Html description
  * @param CalOrganizer $or Organizer
  * @param RecurrenceInfo $recur Recurrence information
  * @param ExceptionRecurIdInfo $exceptId RECURRENCE-ID, if this is an exception
  * @param DtTimeInfo $s Start date-time
  * @param DtTimeInfo $e End date-time
  * @param DurationInfo $dur Duration
  */
 public function __construct($method = null, $compNum = null, $rsvp = null, $priority = null, $name = null, $loc = null, $percentComplete = null, $completed = null, $noBlob = null, FreeBusyStatus $fba = null, FreeBusyStatus $fb = null, Transparency $transp = null, $isOrg = null, $x_uid = null, $uid = null, $seq = null, $date = null, $calItemId = null, $apptId = null, $ciFolder = null, InviteStatus $status = null, InviteClass $class = null, $url = null, $ex = null, $ridZ = null, $allDay = null, $draft = null, $neverSent = null, array $changes = [], array $categories = [], array $comments = [], array $contacts = [], GeoInfo $geo = null, array $attendees = [], array $alarms = [], array $xprops = [], $fr = null, $desc = null, $descHtml = null, CalOrganizer $or = null, RecurrenceInfo $recur = null, ExceptionRecurIdInfo $exceptId = null, DtTimeInfo $s = null, DtTimeInfo $e = null, DurationInfo $dur = null)
 {
     parent::__construct($method, $compNum, $rsvp, $priority, $name, $loc, $percentComplete, $completed, $noBlob, $fba, $fb, $transp, $isOrg, $x_uid, $uid, $seq, $date, $calItemId, $apptId, $ciFolder, $status, $class, $url, $ex, $ridZ, $allDay, $draft, $neverSent, $changes);
     if ($geo instanceof GeoInfo) {
         $this->setChild('geo', $geo);
     }
     if (null !== $fr) {
         $this->setChild('fr', trim($fr));
     }
     if (null !== $desc) {
         $this->setChild('desc', trim($desc));
     }
     if (null !== $descHtml) {
         $this->setChild('descHtml', trim($descHtml));
     }
     if ($or instanceof CalOrganizer) {
         $this->setChild('or', $or);
     }
     if ($recur instanceof RecurrenceInfo) {
         $this->setChild('recur', $recur);
     }
     if ($exceptId instanceof ExceptionRecurIdInfo) {
         $this->setChild('exceptId', $exceptId);
     }
     if ($s instanceof DtTimeInfo) {
         $this->setChild('s', $s);
     }
     if ($e instanceof DtTimeInfo) {
         $this->setChild('e', $e);
     }
     if ($dur instanceof DurationInfo) {
         $this->setChild('dur', $dur);
     }
     $this->setCategories($categories)->setComments($comments)->setContacts($contacts)->setAttendees($attendees)->setAlarms($alarms)->setXProps($xprops);
     $this->on('before', function (InviteComponentCommon $sender) {
         if ($sender->getCategories()->count()) {
             $sender->setChild('category', $sender->getCategories()->all());
         }
         if ($sender->getComments()->count()) {
             $sender->setChild('comment', $sender->getComments()->all());
         }
         if ($sender->getContacts()->count()) {
             $sender->setChild('contact', $sender->getContacts()->all());
         }
         if ($sender->getAttendees()->count()) {
             $sender->setChild('at', $sender->getAttendees()->all());
         }
         if ($sender->getAlarms()->count()) {
             $sender->setChild('alarm', $sender->getAlarms()->all());
         }
         if ($sender->getXProps()->count()) {
             $sender->setChild('xprop', $sender->getXProps()->all());
         }
     });
 }
Exemplo n.º 2
0
 /**
  * Constructor method for InviteComponent
  *
  * @param string $method
  * @param int    $compNum
  * @param bool   $rsvp
  * @param int    $priority
  * @param string $name
  * @param string $loc
  * @param int    $percentComplete
  * @param string $completed
  * @param bool   $noBlob
  * @param FreeBusyStatus $fba
  * @param FreeBusyStatus $fb
  * @param Transparency $transp
  * @param bool   $isOrg
  * @param string $x_uid
  * @param string $uid
  * @param int    $seq
  * @param int    $d
  * @param string $calItemId
  * @param string $apptId
  * @param string $ciFolder
  * @param InviteStatus $status
  * @param InviteClass $class
  * @param string $url
  * @param bool   $ex
  * @param string $ridZ
  * @param bool   $allDay
  * @param bool   $draft
  * @param bool   $neverSent
  * @param array  $change
  * @param array  $category
  * @param array  $comment
  * @param array  $contact
  * @param GeoInfo $geo for iCalendar GEO property
  * @param array  $at
  * @param array  $alarm
  * @param array  $xprop
  * @param string $fr Fragment
  * @param string $desc Description
  * @param string $descHtml Html description
  * @param CalOrganizer $or Organizer
  * @param RecurrenceInfo $recur Recurrence information
  * @param ExceptionRecurIdInfo $exceptId RECURRENCE-ID, if this is an exception
  * @param DtTimeInfo $s Start date-time
  * @param DtTimeInfo $e End date-time
  * @param DurationInfo $dur Duration
  */
 public function __construct($method, $compNum, $rsvp, $priority = null, $name = null, $loc = null, $percentComplete = null, $completed = null, $noBlob = null, FreeBusyStatus $fba = null, FreeBusyStatus $fb = null, Transparency $transp = null, $isOrg = null, $x_uid = null, $uid = null, $seq = null, $d = null, $calItemId = null, $apptId = null, $ciFolder = null, InviteStatus $status = null, InviteClass $class = null, $url = null, $ex = null, $ridZ = null, $allDay = null, $draft = null, $neverSent = null, array $change = array(), array $category = array(), array $comment = array(), array $contact = array(), GeoInfo $geo = null, array $at = array(), array $alarm = array(), array $xprop = array(), $fr = null, $desc = null, $descHtml = null, CalOrganizer $or = null, RecurrenceInfo $recur = null, ExceptionRecurIdInfo $exceptId = null, DtTimeInfo $s = null, DtTimeInfo $e = null, DurationInfo $dur = null)
 {
     parent::__construct($method, $compNum, $rsvp, $priority, $name, $loc, $percentComplete, $completed, $noBlob, $fba, $fb, $transp, $isOrg, $x_uid, $uid, $seq, $d, $calItemId, $apptId, $ciFolder, $status, $class, $url, $ex, $ridZ, $allDay, $draft, $neverSent, $change);
     $this->_category = new Sequence();
     foreach ($category as $value) {
         $value = trim($value);
         if (!$this->_category->contains($value)) {
             $this->_category->add($value);
         }
     }
     $this->_comment = new Sequence();
     foreach ($comment as $value) {
         $value = trim($value);
         if (!$this->_comment->contains($value)) {
             $this->_comment->add($value);
         }
     }
     $this->_contact = new Sequence();
     foreach ($contact as $value) {
         $value = trim($value);
         if (!$this->_contact->contains($value)) {
             $this->_contact->add($value);
         }
     }
     if ($geo instanceof GeoInfo) {
         $this->child('geo', $geo);
     }
     $this->_at = new TypedSequence('Zimbra\\Mail\\Struct\\CalendarAttendee', $at);
     $this->_alarm = new TypedSequence('Zimbra\\Mail\\Struct\\AlarmInfo', $alarm);
     $this->_xprop = new TypedSequence('Zimbra\\Mail\\Struct\\XProp', $xprop);
     if (null !== $fr) {
         $this->child('fr', trim($fr));
     }
     if (null !== $desc) {
         $this->child('desc', trim($desc));
     }
     if (null !== $descHtml) {
         $this->child('descHtml', trim($descHtml));
     }
     if ($or instanceof CalOrganizer) {
         $this->child('or', $or);
     }
     if ($recur instanceof RecurrenceInfo) {
         $this->child('recur', $recur);
     }
     if ($exceptId instanceof ExceptionRecurIdInfo) {
         $this->child('exceptId', $exceptId);
     }
     if ($s instanceof DtTimeInfo) {
         $this->child('s', $s);
     }
     if ($e instanceof DtTimeInfo) {
         $this->child('e', $e);
     }
     if ($dur instanceof DurationInfo) {
         $this->child('dur', $dur);
     }
     $this->on('before', function (InviteComponentCommon $sender) {
         if ($sender->category()->count()) {
             $sender->child('category', $sender->category()->all());
         }
         if ($sender->comment()->count()) {
             $sender->child('comment', $sender->comment()->all());
         }
         if ($sender->contact()->count()) {
             $sender->child('contact', $sender->contact()->all());
         }
         if ($sender->at()->count()) {
             $sender->child('at', $sender->at()->all());
         }
         if ($sender->alarm()->count()) {
             $sender->child('alarm', $sender->alarm()->all());
         }
         if ($sender->xprop()->count()) {
             $sender->child('xprop', $sender->xprop()->all());
         }
     });
 }