本文整理汇总了PHP中Zimbra\Struct\Base::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP Base::__construct方法的具体用法?PHP Base::__construct怎么用?PHP Base::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zimbra\Struct\Base
的用法示例。
在下文中一共展示了Base::__construct方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Constructor method for AddMsgSpec
* @param string $content The entire message's content. (Omit if you specify an "aid" attribute.)
* @param string $f Flags - (u)nread, (f)lagged, has (a)ttachment, (r)eplied, (s)ent by me, for(w)arded, (d)raft, deleted (x), (n)otification sent
* @param string $t Tags - Comma separated list of integers. DEPRECATED - use "tn" instead
* @param string $tn Comma-separated list of tag names
* @param string $l Folder pathname (starts with '/') or folder ID
* @param bool $noICal If set, then don't process iCal attachments. Default is unset.
* @param string $d Time the message was originally received, in MILLISECONDS since the epoch
* @param string $aid Uploaded MIME body ID - ID of message uploaded via FileUploadServlet
* @return self
*/
public function __construct($content = null, $f = null, $t = null, $tn = null, $l = null, $noICal = null, $d = null, $aid = null)
{
parent::__construct();
if (null !== $content) {
$this->child('content', trim($content));
}
if (null !== $f) {
$this->property('f', trim($f));
}
if (null !== $t) {
$this->property('t', trim($t));
}
if (null !== $tn) {
$this->property('tn', trim($tn));
}
if (null !== $l) {
$this->property('l', trim($l));
}
if (null !== $noICal) {
$this->property('noICal', (bool) $noICal);
}
if (null !== $d) {
$this->property('d', trim($d));
}
if (null !== $aid) {
$this->property('aid', trim($aid));
}
}
示例2: __construct
/**
* Constructor method for FolderSpec
* @param string $l Folder ID
* @return self
*/
public function __construct($l = null)
{
parent::__construct();
if (null !== $l) {
$this->property('l', trim($l));
}
}
示例3: __construct
/**
* Constructor method for CalOrganizer
* @param string $address Email address (without "MAILTO:")
* @param string $url URL - has same value as {email-address}.
* @param string $displayName Friendly name - "CN" in iCalendar
* @param string $sentBy iCalendar SENT-BY
* @param string $dir iCalendar DIR - Reference to a directory entry associated with the calendar user. the setProperty.
* @param string $lang iCalendar LANGUAGE - As defined in RFC5646 * (e.g. "en-US")
* @param array $xparams Non-standard parameters
* @return self
*/
public function __construct($address = null, $url = null, $displayName = null, $sentBy = null, $dir = null, $lang = null, array $xparams = [])
{
parent::__construct();
if (null !== $address) {
$this->setProperty('a', trim($address));
}
if (null !== $url) {
$this->setProperty('url', trim($url));
}
if (null !== $displayName) {
$this->setProperty('d', trim($displayName));
}
if (null !== $sentBy) {
$this->setProperty('sentBy', trim($sentBy));
}
if (null !== $dir) {
$this->setProperty('dir', trim($dir));
}
if (null !== $lang) {
$this->setProperty('lang', trim($lang));
}
$this->setXParams($xparams);
$this->on('before', function (Base $sender) {
if ($sender->getXParams()->count()) {
$sender->setChild('xparam', $sender->getXParams()->all());
}
});
}
示例4: __construct
/**
* Constructor method for DurationInfo
* @param bool $neg Set if the duration is negative.
* @param int $w Weeks component of the duration
* @param int $d Days component of the duration.
* @param int $h Hours component of the duration.
* @param int $m Minutes component of the duration.
* @param int $s Seconds component of the duration.
* @param string $related Specifies whether the alarm is related to the start of end. Valid values are : START|END
* @param int $count Alarm repeat count
* @return self
*/
public function __construct($neg = null, $w = null, $d = null, $h = null, $m = null, $s = null, $related = null, $count = null)
{
parent::__construct();
if (null !== $neg) {
$this->property('neg', (bool) $neg);
}
if (null !== $w) {
$this->property('w', (int) $w);
}
if (null !== $d) {
$this->property('d', (int) $d);
}
if (null !== $h) {
$this->property('h', (int) $h);
}
if (null !== $m) {
$this->property('m', (int) $m);
}
if (null !== $s) {
$this->property('s', (int) $s);
}
if (null !== $related) {
$this->property('related', in_array(trim($related), array('START', 'END')) ? trim($related) : '');
}
if (null !== $count) {
$this->property('count', (int) $count);
}
}
示例5: __construct
/**
* Constructor method for PrefInfo
* @param string $name Preference name
* @param string $value Preference value
* @return self
*/
public function __construct($name = null, $value = null)
{
parent::__construct($value);
if (null !== $name) {
$this->setProperty('name', trim($name));
}
}
示例6: __construct
/**
* Constructor method for DurationInfo
* @param bool $neg Set if the duration is negative.
* @param int $weeks Weeks component of the duration
* @param int $days Days component of the duration.
* @param int $hours Hours component of the duration.
* @param int $minutes Minutes component of the duration.
* @param int $seconds Seconds component of the duration.
* @param string $related Specifies whether the alarm is related to the start of end. Valid values are : START|END
* @param int $count Alarm repeat count
* @return self
*/
public function __construct($negative = null, $weeks = null, $days = null, $hours = null, $minutes = null, $seconds = null, $related = null, $count = null)
{
parent::__construct();
if (null !== $negative) {
$this->setProperty('neg', (bool) $negative);
}
if (null !== $weeks) {
$this->setProperty('w', (int) $weeks);
}
if (null !== $days) {
$this->setProperty('d', (int) $days);
}
if (null !== $hours) {
$this->setProperty('h', (int) $hours);
}
if (null !== $minutes) {
$this->setProperty('m', (int) $minutes);
}
if (null !== $seconds) {
$this->setProperty('s', (int) $seconds);
}
if (null !== $related) {
$this->setRelated($related);
}
if (null !== $count) {
$this->setProperty('count', (int) $count);
}
}
示例7: __construct
/**
* Constructor method for AttachmentsInfo
* @param string $aid Attachment upload ID
* @param MimePartAttachSpec $mp MimePart Attach Spec
* @param MsgAttachSpec $m Msg Attach Spec
* @param ContactAttachSpec $cn Contact Attach Spec
* @param DocAttachSpec $doc Doc Attach Spec
* @return self
*/
public function __construct($aid = null, array $attachments = [])
{
parent::__construct();
parent::__construct();
$this->setProperty('aid', trim($aid));
$this->setAttachments($attachments);
$this->on('before', function (Base $sender) {
if ($sender->getAttachments()->count()) {
foreach ($sender->getAttachments()->all() as $attachment) {
if ($attachment instanceof MimePartAttachSpec) {
$this->setChild('mp', $attachment);
}
if ($attachment instanceof MsgAttachSpec) {
$this->setChild('m', $attachment);
}
if ($attachment instanceof ContactAttachSpec) {
$this->setChild('cn', $attachment);
}
if ($attachment instanceof DocAttachSpec) {
$this->setChild('doc', $attachment);
}
}
}
});
}
示例8: __construct
/**
* Constructor method for NewFolderSpec
* @param string $name If "l" is unset, name is the full path of the new folder; otherwise, name may not contain the folder separator '/'
* @param SearchType $view Default type for the folder; used by web client to decide which view to use; possible values are the same as <SearchRequest>'s {types}: conversation|message|contact|etc
* @param string $f Flags
* @param int $color Color numeric; range 0-127; defaults to 0 if not present; client can display only 0-7
* @param string $rgb RGB color in format #rrggbb where r,g and b are hex digits
* @param string $url URL (RSS, iCal, etc.) this folder syncs its contents to
* @param string $l Parent folder ID
* @param bool $fie If set, the server will fetch the folder if it already exists rather than throwing mail.ALREADY_EXISTS
* @param bool $sync If set (default) then if "url" is set, synchronize folder content on folder creation
* @param NewFolderSpecAcl $acl Action grant selectors
* @return self
*/
public function __construct($name, SearchType $view = null, $f = null, $color = null, $rgb = null, $url = null, $l = null, $fie = null, $sync = null, NewFolderSpecAcl $grants = null)
{
parent::__construct();
$this->setProperty('name', trim($name));
if ($view instanceof SearchType) {
$this->setProperty('view', $view);
}
if (null !== $f) {
$this->setProperty('f', trim($f));
}
if (null !== $color) {
$color = (int) $color;
$this->setProperty('color', $color > 0 && $color < 128 ? $color : 0);
}
if (null !== $rgb && Text::isRgb(trim($rgb))) {
$this->setProperty('rgb', trim($rgb));
}
if (null !== $url) {
$this->setProperty('url', trim($url));
}
if (null !== $l) {
$this->setProperty('l', trim($l));
}
if (null !== $fie) {
$this->setProperty('fie', (bool) $fie);
}
if (null !== $sync) {
$this->setProperty('sync', (bool) $sync);
}
if ($grants instanceof NewFolderSpecAcl) {
$this->setChild('acl', $grants);
}
}
示例9: __construct
/**
* Constructor method for CalOrganizer
* @param array $xparams
* @param string $a Email address (without "MAILTO:")
* @param string $url URL - has same value as {email-address}.
* @param string $d Friendly name - "CN" in iCalendar
* @param string $sentBy iCalendar SENT-BY
* @param string $dir iCalendar DIR - Reference to a directory entry associated with the calendar user. the property.
* @param string $lang iCalendar LANGUAGE - As defined in RFC5646 * (e.g. "en-US")
* @return self
*/
public function __construct(array $xparams = array(), $a = null, $url = null, $d = null, $sentBy = null, $dir = null, $lang = null)
{
parent::__construct();
$this->_xparam = new TypedSequence('Zimbra\\Mail\\Struct\\XParam', $xparams);
if (null !== $a) {
$this->property('a', trim($a));
}
if (null !== $url) {
$this->property('url', trim($url));
}
if (null !== $d) {
$this->property('d', trim($d));
}
if (null !== $sentBy) {
$this->property('sentBy', trim($sentBy));
}
if (null !== $dir) {
$this->property('dir', trim($dir));
}
if (null !== $lang) {
$this->property('lang', trim($lang));
}
$this->on('before', function (Base $sender) {
if ($sender->xparam()->count()) {
$sender->child('xparam', $sender->xparam()->all());
}
});
}
示例10: __construct
/**
* Constructor method for AlarmInfo
* @param AlarmAction $action Alarm action
* @param AlarmTriggerInfo $trigger Alarm trigger information
* @param DurationInfo $repeat Alarm repeat information
* @param string $description Alarm description
* @param CalendarAttach $attach Information on attachment
* @param string $summary Alarm summary
* @param array $ats Attendee information
* @param array $xprops Non-standard properties
* @return self
*/
public function __construct(AlarmAction $action, AlarmTriggerInfo $trigger = null, DurationInfo $repeat = null, $description = null, CalendarAttach $attach = null, $summary = null, array $ats = [], array $xprops = [])
{
parent::__construct();
$this->setProperty('action', $action);
if ($trigger instanceof AlarmTriggerInfo) {
$this->setChild('trigger', $trigger);
}
if ($repeat instanceof DurationInfo) {
$this->setChild('repeat', $repeat);
}
if (null !== $description) {
$this->setChild('desc', trim($description));
}
if ($attach instanceof CalendarAttach) {
$this->setChild('attach', $attach);
}
if (null !== $summary) {
$this->setChild('summary', trim($summary));
}
$this->setAttendees($ats)->setXProps($xprops);
$this->on('before', function (Base $sender) {
if ($sender->getAttendees()->count()) {
$sender->setChild('at', $sender->getAttendees()->all());
}
if ($sender->getXProps()->count()) {
$sender->setChild('xprop', $sender->getXProps()->all());
}
});
}
示例11: __construct
/**
* Constructor method for FolderSpec
* @param string $folder Folder ID
* @return self
*/
public function __construct($folder = null)
{
parent::__construct();
if (null !== $folder) {
$this->setProperty('l', trim($folder));
}
}
示例12: __construct
/**
* Constructor method for RecurIdInfo
* @param array $rules Recurrence rules
* @return self
*/
public function __construct(array $rules = [])
{
parent::__construct();
$this->setRules($rules);
$this->on('before', function (Base $sender) {
if ($sender->getRules()->count()) {
foreach ($sender->getRules()->all() as $rule) {
if ($rule instanceof AddRecurrenceInfo) {
$this->setChild('add', $rule);
}
if ($rule instanceof ExcludeRecurrenceInfo) {
$this->setChild('exclude', $rule);
}
if ($rule instanceof ExceptionRuleInfo) {
$this->setChild('except', $rule);
}
if ($rule instanceof CancelRuleInfo) {
$this->setChild('cancel', $rule);
}
if ($rule instanceof SingleDates) {
$this->setChild('dates', $rule);
}
if ($rule instanceof SimpleRepeatingRule) {
$this->setChild('rule', $rule);
}
}
}
});
}
示例13: __construct
/**
* Constructor method for ContactSpec
* @param int $id ID - specified when modifying a contact
* @param string $folder ID of folder to create contact in. Un-specified means use the default Contacts folder.
* @param string $tags Tags - Comma separated list of integers. DEPRECATED - use "tn" instead
* @param string $tagNames Comma-separated list of id names
* @param VCardInfo $vcard Either a vcard or attributes can be specified but not both.
* @param array $attrs Contact attributes. Cannot specify <vcard> as well as these
* @param array $members Contact group members. Valid only if the contact being created is a contact group (has attribute type="group")
* @return self
*/
public function __construct($id = null, $folder = null, $tags = null, $tagNames = null, VCardInfo $vcard = null, array $attrs = [], array $members = [])
{
parent::__construct();
if (null !== $id) {
$this->setProperty('id', (int) $id);
}
if (null !== $folder) {
$this->setProperty('l', trim($folder));
}
if (null !== $tags) {
$this->setProperty('t', trim($tags));
}
if (null !== $tagNames) {
$this->setProperty('tn', trim($tagNames));
}
if ($vcard instanceof VCardInfo) {
$this->setChild('vcard', $vcard);
}
$this->setAttrs($attrs)->setGroupMembers($members);
$this->on('before', function (Base $sender) {
if ($sender->getAttrs()->count()) {
$sender->setChild('a', $sender->getAttrs()->all());
}
if ($sender->getGroupMembers()->count()) {
$sender->setChild('m', $sender->getGroupMembers()->all());
}
});
}
示例14: __construct
/**
* Constructor method for AttachmentIdAttrib
* @param string $aid Attachment ID
* @return self
*/
public function __construct($aid = null)
{
parent::__construct();
if (null !== $aid) {
$this->setProperty('aid', trim($aid));
}
}
示例15: __construct
/**
* Constructor method for AuthToken
* @param string $value
* @param bool $verifyAccount
* @return self
*/
public function __construct($value, $verifyAccount = null)
{
parent::__construct(trim($value));
if (null !== $verifyAccount) {
$this->setProperty('verifyAccount', (bool) $verifyAccount);
}
}