本文整理汇总了PHP中Zimbra\Mail\Request\Base::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP Base::__construct方法的具体用法?PHP Base::__construct怎么用?PHP Base::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zimbra\Mail\Request\Base
的用法示例。
在下文中一共展示了Base::__construct方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* 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);
}
}
}
});
}
示例2: __construct
/**
* 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);
}
}
}
});
}
示例3: __construct
/**
* 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);
}
}
示例4: __construct
/**
* 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);
}
}
示例5: __construct
/**
* 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);
}
}
示例6: __construct
/**
* 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());
}
});
}
示例7: __construct
/**
* 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);
}
});
}
示例8: __construct
/**
* 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);
}
}
示例9: __construct
/**
* Constructor method for ModifyDataSource
* @param MailDataSource $ds
* @return self
*/
public function __construct(MailDataSource $ds = null)
{
parent::__construct();
if ($ds instanceof MailImapDataSource) {
$this->child('imap', $ds);
}
if ($ds instanceof MailPop3DataSource) {
$this->child('pop3', $ds);
}
if ($ds instanceof MailCaldavDataSource) {
$this->child('caldav', $ds);
}
if ($ds instanceof MailYabDataSource) {
$this->child('yab', $ds);
}
if ($ds instanceof MailRssDataSource) {
$this->child('rss', $ds);
}
if ($ds instanceof MailGalDataSource) {
$this->child('gal', $ds);
}
if ($ds instanceof MailCalDataSource) {
$this->child('cal', $ds);
}
if ($ds instanceof MailUnknownDataSource) {
$this->child('unknown', $ds);
}
}
示例10: __construct
/**
* 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);
}
});
}
示例11: __construct
/**
* 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);
}
}
示例12: __construct
/**
* 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);
}
});
}
示例13: __construct
/**
* 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);
}
});
}
示例14: __construct
/**
* 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);
}
}
示例15: __construct
/**
* 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);
}
}