作者:zimbra-ap
项目:mai
/**
* 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);
}
}
}
});
}
作者:nucleus-b
项目:zimbra-ap
/**
* 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());
}
});
}
作者:zimbra-ap
项目:mai
/**
* 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);
}
});
}
作者:zimbra-ap
项目:mai
/**
* 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);
}
}
}
});
}
作者:zimbra-ap
项目:mai
/**
* 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);
}
});
}
作者:nucleus-b
项目:zimbra-ap
/**
* 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);
}
});
}
作者:zimbra-ap
项目:mai
/**
* 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);
}
});
}
作者:nucleus-b
项目:zimbra-ap
/**
* 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());
}
});
}
作者:zimbra-ap
项目:mai
/**
* 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());
}
});
}
作者:zimbra-ap
项目:mai
/**
* 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());
}
});
}
作者:zimbra-ap
项目:mai
/**
* 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);
}
}
作者:nucleus-b
项目:zimbra-ap
/**
* 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);
}
}
作者:nucleus-b
项目:zimbra-ap
/**
* 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);
}
}
作者:nucleus-b
项目:zimbra-ap
/**
* 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);
}
}
作者:zimbra-ap
项目:mai
/**
* 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);
}
}
作者:zimbra-ap
项目:mai
/**
* 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);
}
}
作者:nucleus-b
项目:zimbra-ap
/**
* 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);
}
}
作者:nucleus-b
项目:zimbra-ap
/**
* 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);
}
}
作者:nucleus-b
项目:zimbra-ap
/**
* 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);
}
}
作者:nucleus-b
项目:zimbra-ap
/**
* 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));
}
}