Beispiel #1
0
 /**
  * Constructor method for SetMailboxMetadata
  * @param  MailCustomMetadata $meta
  * @return self
  */
 public function __construct(MailCustomMetadata $meta = null)
 {
     parent::__construct();
     if ($meta instanceof MailCustomMetadata) {
         $this->setChild('meta', $meta);
     }
 }
 /**
  * Constructor method for DeclineCounterAppointment
  * @param  Msg $m
  * @return self
  */
 public function __construct(Msg $m = null)
 {
     parent::__construct();
     if ($m instanceof Msg) {
         $this->child('m', $m);
     }
 }
Beispiel #3
0
 /**
  * Constructor method for ExpandRecur
  * @param  int $startTime
  * @param  int $endTime
  * @param  array $timezones
  * @param  array $components
  * @return self
  */
 public function __construct($startTime, $endTime, array $timezones = [], array $components = [])
 {
     parent::__construct();
     $this->setProperty('s', (int) $startTime);
     $this->setProperty('e', (int) $endTime);
     $this->setTimezones($timezones);
     $this->setComponents($components);
     $this->on('before', function (Base $sender) {
         if ($sender->getTimezones()->count()) {
             $sender->setChild('tz', $sender->getTimezones()->all());
         }
         if ($sender->getComponents()->count()) {
             foreach ($sender->getComponents()->all() as $component) {
                 if ($component instanceof ExpandedRecurrenceInvite) {
                     $this->setChild('comp', $component);
                 }
                 if ($component instanceof ExpandedRecurrenceException) {
                     $this->setChild('except', $component);
                 }
                 if ($component instanceof ExpandedRecurrenceCancel) {
                     $this->setChild('cancel', $component);
                 }
             }
         }
     });
 }
 /**
  * Constructor method for CheckRecurConflicts
  * @param  array $tz
  * @param  ExpandedRecurrenceCancel $cancel
  * @param  ExpandedRecurrenceInvite $comp
  * @param  ExpandedRecurrenceException $except
  * @param  array $usr
  * @param  int $s
  * @param  int $e
  * @param  bool $all
  * @param  string $excludeUid
  * @return self
  */
 public function __construct(array $tz = array(), ExpandedRecurrenceCancel $cancel = null, ExpandedRecurrenceInvite $comp = null, ExpandedRecurrenceException $except = null, array $usr = array(), $s = null, $e = null, $all = null, $excludeUid = null)
 {
     parent::__construct();
     $this->_tz = new TypedSequence('Zimbra\\Mail\\Struct\\CalTZInfo', $tz);
     if ($cancel instanceof ExpandedRecurrenceCancel) {
         $this->child('cancel', $cancel);
     }
     if ($comp instanceof ExpandedRecurrenceInvite) {
         $this->child('comp', $comp);
     }
     if ($except instanceof ExpandedRecurrenceException) {
         $this->child('except', $except);
     }
     $this->_usr = new TypedSequence('Zimbra\\Mail\\Struct\\FreeBusyUserSpec', $usr);
     if (null !== $s) {
         $this->property('s', (int) $s);
     }
     if (null !== $e) {
         $this->property('e', (int) $e);
     }
     if (null !== $all) {
         $this->property('all', (bool) $all);
     }
     if (null !== $excludeUid) {
         $this->property('excludeUid', trim($excludeUid));
     }
     $this->on('before', function (Base $sender) {
         if ($sender->tz()->count()) {
             $sender->child('tz', $sender->tz()->all());
         }
         if ($sender->usr()->count()) {
             $sender->child('usr', $sender->usr()->all());
         }
     });
 }
Beispiel #5
0
 /**
  * Constructor method for WaitSet
  * @param string $waitSet Waitset ID
  * @param string $seq Last known sequence number
  * @param WaitSetSpec $addAccounts The WaitSet add spec
  * @param WaitSetSpec $updateAccounts The WaitSet update spec
  * @param WaitSetId $removeAccounts The WaitSet remove spec
  * @param bool   $block Flag whether or not to block until some account has new data
  * @param array  $defTypes Default interest types. Comma-separated list
  * @param int    $timeout Timeout length
  * @return self
  */
 public function __construct($waitSet, $seq, WaitSetSpec $addAccounts = null, WaitSetSpec $updateAccounts = null, WaitSetId $removeAccounts = null, $block = null, array $defTypes = [], $timeout = null)
 {
     parent::__construct();
     $this->setProperty('waitSet', trim($waitSet));
     $this->setProperty('seq', trim($seq));
     if ($addAccounts instanceof WaitSetSpec) {
         $this->setChild('add', $addAccounts);
     }
     if ($updateAccounts instanceof WaitSetSpec) {
         $this->setChild('update', $updateAccounts);
     }
     if ($removeAccounts instanceof WaitSetId) {
         $this->setChild('remove', $removeAccounts);
     }
     if (null !== $block) {
         $this->setProperty('block', (bool) $block);
     }
     if (null !== $timeout) {
         $this->setProperty('timeout', (int) $timeout);
     }
     $this->setDefaultInterests($defTypes);
     $this->on('before', function (Base $sender) {
         $defTypes = $sender->getDefaultInterests();
         if (!empty($defTypes)) {
             $sender->setProperty('defTypes', $defTypes);
         }
     });
 }
Beispiel #6
0
 /**
  * Constructor method for ImportData
  * @param  array $dataSources
  * @return self
  */
 public function __construct(array $dataSources = [])
 {
     parent::__construct();
     $this->setDataSources($dataSources);
     $this->on('before', function (Base $sender) {
         if ($sender->getDataSources()->count()) {
             foreach ($sender->getDataSources()->all() as $dataSource) {
                 if ($dataSource instanceof ImapDataSourceNameOrId) {
                     $this->setChild('imap', $dataSource);
                 }
                 if ($dataSource instanceof Pop3DataSourceNameOrId) {
                     $this->setChild('pop3', $dataSource);
                 }
                 if ($dataSource instanceof CaldavDataSourceNameOrId) {
                     $this->setChild('caldav', $dataSource);
                 }
                 if ($dataSource instanceof YabDataSourceNameOrId) {
                     $this->setChild('yab', $dataSource);
                 }
                 if ($dataSource instanceof RssDataSourceNameOrId) {
                     $this->setChild('rss', $dataSource);
                 }
                 if ($dataSource instanceof GalDataSourceNameOrId) {
                     $this->setChild('gal', $dataSource);
                 }
                 if ($dataSource instanceof CalDataSourceNameOrId) {
                     $this->setChild('cal', $dataSource);
                 }
                 if ($dataSource instanceof UnknownDataSourceNameOrId) {
                     $this->setChild('unknown', $dataSource);
                 }
             }
         }
     });
 }
 /**
  * Constructor method for DeleteDataSource
  * @param  ImapDataSourceNameOrId $imap
  * @param  Pop3DataSourceNameOrId $pop3
  * @param  CaldavDataSourceNameOrId $caldav
  * @param  YabDataSourceNameOrId $yab
  * @param  RssDataSourceNameOrId $rss
  * @param  GalDataSourceNameOrId $gal
  * @param  CalDataSourceNameOrId $cal
  * @param  UnknownDataSourceNameOrId $unknown
  * @return self
  */
 public function __construct(ImapDataSourceNameOrId $imap = null, Pop3DataSourceNameOrId $pop3 = null, CaldavDataSourceNameOrId $caldav = null, YabDataSourceNameOrId $yab = null, RssDataSourceNameOrId $rss = null, GalDataSourceNameOrId $gal = null, CalDataSourceNameOrId $cal = null, UnknownDataSourceNameOrId $unknown = null)
 {
     parent::__construct();
     if ($imap instanceof ImapDataSourceNameOrId) {
         $this->child('imap', $imap);
     }
     if ($pop3 instanceof Pop3DataSourceNameOrId) {
         $this->child('pop3', $pop3);
     }
     if ($caldav instanceof CaldavDataSourceNameOrId) {
         $this->child('caldav', $caldav);
     }
     if ($yab instanceof YabDataSourceNameOrId) {
         $this->child('yab', $yab);
     }
     if ($rss instanceof RssDataSourceNameOrId) {
         $this->child('rss', $rss);
     }
     if ($gal instanceof GalDataSourceNameOrId) {
         $this->child('gal', $gal);
     }
     if ($cal instanceof CalDataSourceNameOrId) {
         $this->child('cal', $cal);
     }
     if ($unknown instanceof UnknownDataSourceNameOrId) {
         $this->child('unknown', $unknown);
     }
 }
Beispiel #8
0
 /**
  * Constructor method for TestDataSource
  * @param  MailDataSource $dataSource
  * @return self
  */
 public function __construct(MailDataSource $dataSource = null)
 {
     parent::__construct();
     if ($dataSource instanceof MailDataSource) {
         $this->_dataSource = $dataSource;
     }
     $this->on('before', function (Base $sender) {
         if ($this->_dataSource instanceof MailImapDataSource) {
             $this->setChild('imap', $this->_dataSource);
         }
         if ($this->_dataSource instanceof MailPop3DataSource) {
             $this->setChild('pop3', $this->_dataSource);
         }
         if ($this->_dataSource instanceof MailCaldavDataSource) {
             $this->setChild('caldav', $this->_dataSource);
         }
         if ($this->_dataSource instanceof MailYabDataSource) {
             $this->setChild('yab', $this->_dataSource);
         }
         if ($this->_dataSource instanceof MailRssDataSource) {
             $this->setChild('rss', $this->_dataSource);
         }
         if ($this->_dataSource instanceof MailGalDataSource) {
             $this->setChild('gal', $this->_dataSource);
         }
         if ($this->_dataSource instanceof MailCalDataSource) {
             $this->setChild('cal', $this->_dataSource);
         }
         if ($this->_dataSource instanceof MailUnknownDataSource) {
             $this->setChild('unknown', $this->_dataSource);
         }
     });
 }
 /**
  * Constructor method for GetMailboxMetadata
  * @param  SectionAttr $meta
  * @return self
  */
 public function __construct(SectionAttr $meta = null)
 {
     parent::__construct();
     if ($meta instanceof SectionAttr) {
         $this->child('meta', $meta);
     }
 }
Beispiel #10
0
 /**
  * Constructor method for CancelAppointment
  * @param  InstanceRecurIdInfo $inst
  * @param  CalTZInfo $tz
  * @param  Msg $m
  * @param  string $id
  * @param  int $comp
  * @param  int $ms
  * @param  int $rev
  * @return self
  */
 public function __construct(InstanceRecurIdInfo $inst = null, CalTZInfo $tz = null, Msg $m = null, $id = null, $comp = null, $ms = null, $rev = null)
 {
     parent::__construct();
     if ($inst instanceof InstanceRecurIdInfo) {
         $this->setChild('inst', $inst);
     }
     if ($tz instanceof CalTZInfo) {
         $this->setChild('tz', $tz);
     }
     if ($m instanceof Msg) {
         $this->setChild('m', $m);
     }
     if (null !== $id) {
         $this->setProperty('id', trim($id));
     }
     if (null !== $comp) {
         $this->setProperty('comp', (int) $comp);
     }
     if (null !== $ms) {
         $this->setProperty('ms', (int) $ms);
     }
     if (null !== $rev) {
         $this->setProperty('rev', (int) $rev);
     }
 }
Beispiel #11
0
 /**
  * Constructor method for WaitSet
  * @param  string $waitSet
  * @param  string $seq
  * @param  WaitSetSpec $add
  * @param  WaitSetSpec $update
  * @param  WaitSetId $remove
  * @param  bool $block
  * @param  array $defTypes
  * @param  int $timeout
  * @return self
  */
 public function __construct($waitSet, $seq, WaitSetSpec $add = null, WaitSetSpec $update = null, WaitSetId $remove = null, $block = null, array $defTypes = array(), $timeout = null)
 {
     parent::__construct();
     $this->property('waitSet', trim($waitSet));
     $this->property('seq', trim($seq));
     if ($add instanceof WaitSetSpec) {
         $this->child('add', $add);
     }
     if ($update instanceof WaitSetSpec) {
         $this->child('update', $update);
     }
     if ($remove instanceof WaitSetId) {
         $this->child('remove', $remove);
     }
     if (null !== $block) {
         $this->property('block', (bool) $block);
     }
     $this->_defTypes = new TypedSequence('Zimbra\\Enum\\InterestType', $defTypes);
     if (null !== $timeout) {
         $this->property('timeout', (int) $timeout);
     }
     $this->on('before', function (Base $sender) {
         $defTypes = $sender->defTypes();
         if (!empty($defTypes)) {
             $sender->property('defTypes', $defTypes);
         }
     });
 }
Beispiel #12
0
 /**
  * Constructor method for DeleteDataSource
  * @param  DataSourceNameOrId $ds
  * @return self
  */
 public function __construct(DataSourceNameOrId $ds = null)
 {
     parent::__construct();
     if ($ds instanceof DataSourceNameOrId) {
         $this->_dataSource = $ds;
     }
     $this->on('before', function (Base $sender) {
         if ($this->_dataSource instanceof ImapDataSourceNameOrId) {
             $this->setChild('imap', $this->_dataSource);
         }
         if ($this->_dataSource instanceof Pop3DataSourceNameOrId) {
             $this->setChild('pop3', $this->_dataSource);
         }
         if ($this->_dataSource instanceof CaldavDataSourceNameOrId) {
             $this->setChild('caldav', $this->_dataSource);
         }
         if ($this->_dataSource instanceof YabDataSourceNameOrId) {
             $this->setChild('yab', $this->_dataSource);
         }
         if ($this->_dataSource instanceof RssDataSourceNameOrId) {
             $this->setChild('rss', $this->_dataSource);
         }
         if ($this->_dataSource instanceof GalDataSourceNameOrId) {
             $this->setChild('gal', $this->_dataSource);
         }
         if ($this->_dataSource instanceof CalDataSourceNameOrId) {
             $this->setChild('cal', $this->_dataSource);
         }
         if ($this->_dataSource instanceof UnknownDataSourceNameOrId) {
             $this->setChild('unknown', $this->_dataSource);
         }
     });
 }
Beispiel #13
0
 /**
  * Constructor method for GetCustomMetadata
  * @param  string $id
  * @param  SectionAttr $metadata
  * @return self
  */
 public function __construct($id, SectionAttr $metadata = null)
 {
     parent::__construct();
     $this->setProperty('id', trim($id));
     if ($metadata instanceof SectionAttr) {
         $this->setChild('meta', $metadata);
     }
 }
Beispiel #14
0
 /**
  * Constructor method for CreateContact
  * @param  ContactSpec $cn
  * @param  bool $verbose
  * @return self
  */
 public function __construct(ContactSpec $cn, $verbose = null)
 {
     parent::__construct();
     $this->child('cn', $cn);
     if (null !== $verbose) {
         $this->property('verbose', (bool) $verbose);
     }
 }
Beispiel #15
0
 /**
  * Constructor method for AddMsg
  * @param  AddMsgSpec $m
  * @param  bool $filterSent
  * @return self
  */
 public function __construct(AddMsgSpec $m, $filterSent = null)
 {
     parent::__construct();
     $this->child('m', $m);
     if (null !== $filterSent) {
         $this->property('filterSent', (bool) $filterSent);
     }
 }
 /**
  * Constructor method for SetCustomMetadata
  * @param  string $id
  * @param  MailCustomMetadata $meta
  * @return self
  */
 public function __construct($id, MailCustomMetadata $meta = null)
 {
     parent::__construct();
     $this->property('id', trim($id));
     if ($meta instanceof MailCustomMetadata) {
         $this->child('meta', $meta);
     }
 }
 /**
  * Constructor method for ImportAppointments
  * @param  ContentSpec $content
  * @param  string $ct
  * @param  string $l
  * @return self
  */
 public function __construct(ContentSpec $content, $ct, $l = null)
 {
     parent::__construct();
     $this->child('content', $content);
     $this->property('ct', trim($ct));
     if (null !== $l) {
         $this->property('l', trim($l));
     }
 }
 /**
  * Constructor method for CompleteTaskInstance
  * @param  string $id
  * @param  DtTimeInfo $exceptId
  * @param  CalTZInfo $tz
  * @return self
  */
 public function __construct($id, DtTimeInfo $exceptId, CalTZInfo $tz = null)
 {
     parent::__construct();
     $this->setProperty('id', trim($id));
     $this->setChild('exceptId', $exceptId);
     if ($tz instanceof CalTZInfo) {
         $this->setChild('tz', $tz);
     }
 }
Beispiel #19
0
 /**
  * Constructor method for ImportAppointments
  * @param  string $contentType
  * @param  ContentSpec $content
  * @param  string $folderId
  * @return self
  */
 public function __construct($contentType, ContentSpec $content, $folderId = null)
 {
     parent::__construct();
     $this->setProperty('ct', trim($contentType));
     $this->setChild('content', $content);
     if (null !== $folderId) {
         $this->setProperty('l', trim($folderId));
     }
 }
Beispiel #20
0
 /**
  * Constructor method for GetPermission
  * @param  Right $ace
  * @return self
  */
 public function __construct(array $ace = array())
 {
     parent::__construct();
     $this->_ace = new TypedSequence('Zimbra\\Mail\\Struct\\Right', $ace);
     $this->on('before', function (Base $sender) {
         if ($sender->ace()->count()) {
             $sender->child('ace', $sender->ace()->all());
         }
     });
 }
 /**
  * Constructor method for DismissCalendarItemAlarm
  * @param  DismissAppointmentAlarm $appt
  * @param  DismissTaskAlarm $task
  * @return self
  */
 public function __construct(DismissAppointmentAlarm $appt = null, DismissTaskAlarm $task = null)
 {
     parent::__construct();
     if ($appt instanceof DismissAppointmentAlarm) {
         $this->child('appt', $appt);
     }
     if ($task instanceof DismissTaskAlarm) {
         $this->child('task', $task);
     }
 }
 /**
  * Gets or sets child
  *
  * @param  string $name
  * @param  mix $value
  * @return string|self
  */
 public function child($name, $value = null)
 {
     if ($value instanceof MailDataSource) {
         $dataSources = array('imap', 'pop3', 'caldav', 'yab', 'rss', 'gal', 'cal', 'unknown');
         foreach ($dataSources as $ds) {
             $this->removeChild($ds);
         }
     }
     return parent::child($name, $value);
 }
 /**
  * Constructor method for ForwardAppointmentInvite
  * @param  Msg $m
  * @param  string $id
  * @return self
  */
 public function __construct(Msg $m = null, $id = null)
 {
     parent::__construct();
     if ($m instanceof Msg) {
         $this->child('m', $m);
     }
     if (null !== $id) {
         $this->property('id', trim($id));
     }
 }
Beispiel #24
0
 /**
  * Constructor method for RevokePermission
  * @param  array $ace;
  * @return self
  */
 public function __construct(array $aces = array())
 {
     parent::__construct();
     $this->setAces($aces);
     $this->on('before', function (Base $sender) {
         if ($sender->getAces()->count()) {
             $sender->setChild('ace', $sender->getAces()->all());
         }
     });
 }
 /**
  * Constructor method for AddAppointmentInvite
  * @param  Msg $m
  * @param  ParticipationStatus $ptst
  * @return self
  */
 public function __construct(Msg $m = null, ParticipationStatus $ptst = null)
 {
     parent::__construct();
     if ($m instanceof Msg) {
         $this->child('m', $m);
     }
     if ($ptst instanceof ParticipationStatus) {
         $this->property('ptst', $ptst);
     }
 }
 /**
  * Constructor method for ForwardAppointmentInvite
  * @param  string $id
  * @param  Msg $msg
  * @return self
  */
 public function __construct($id = null, Msg $msg = null)
 {
     parent::__construct();
     if (null !== $id) {
         $this->setProperty('id', trim($id));
     }
     if ($msg instanceof Msg) {
         $this->setChild('m', $msg);
     }
 }
Beispiel #27
0
 /**
  * Constructor method for ModifyContact
  * @param  ModifyContactSpec $cn
  * @param  bool $replace
  * @param  bool $verbose
  * @return self
  */
 public function __construct(ModifyContactSpec $cn, $replace = null, $verbose = null)
 {
     parent::__construct();
     $this->setChild('cn', $cn);
     if (null !== $replace) {
         $this->setProperty('replace', (bool) $replace);
     }
     if (null !== $verbose) {
         $this->setProperty('verbose', (bool) $verbose);
     }
 }
 /**
  * Constructor method for ApplyFilterRules
  * @param  NamedFilterRules $filterRules
  * @param  IdsAttr $m
  * @param  string $query
  * @return self
  */
 public function __construct(NamedFilterRules $filterRules, IdsAttr $m = null, $query = null)
 {
     parent::__construct();
     $this->child('filterRules', $filterRules);
     if ($m instanceof IdsAttr) {
         $this->child('m', $m);
     }
     if (null !== $query) {
         $this->child('query', trim($query));
     }
 }
Beispiel #29
0
 /**
  * Constructor method for BounceMsg
  * @param  BrowseBy $browseBy
  * @param  string $regex
  * @param  int $maxToReturn
  * @return self
  */
 public function __construct(BrowseBy $browseBy, $regex = null, $maxToReturn = null)
 {
     parent::__construct();
     $this->setProperty('browseBy', $browseBy);
     if (null !== $regex) {
         $this->setProperty('regex', trim($regex));
     }
     if (null !== $maxToReturn) {
         $this->setProperty('maxToReturn', (int) $maxToReturn);
     }
 }
Beispiel #30
0
 /**
  * Constructor method for CheckPermission
  * @param  TargetSpec $target
  * @param  array $rights rights to check
  * @return self
  */
 public function __construct(TargetSpec $target = null, array $rights = array())
 {
     parent::__construct();
     if ($target instanceof TargetSpec) {
         $this->setChild('target', $target);
     }
     $this->setRights($rights);
     $this->on('before', function (Base $sender) {
         if ($sender->getRights()->count()) {
             $sender->setChild('right', $sender->getRights()->all());
         }
     });
 }