Skip to content

Commit

Permalink
Set method, compNum, rsvp propertiest of invitation are optional
Browse files Browse the repository at this point in the history
  • Loading branch information
nguyennv committed Sep 9, 2016
1 parent 8cb29f6 commit 6c3fa89
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 12 deletions.
6 changes: 3 additions & 3 deletions src/Zimbra/Mail/Struct/InvitationInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,9 @@ class InvitationInfo extends InviteComponent
* @param string $ci
*/
public function __construct(
$method,
$compNum,
$rsvp,
$method = null,
$compNum = null,
$rsvp = null,
$priority = null,
$name = null,
$loc = null,
Expand Down
6 changes: 3 additions & 3 deletions src/Zimbra/Mail/Struct/InviteComponent.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,9 @@ class InviteComponent extends InviteComponentCommon
* @param DurationInfo $dur Duration
*/
public function __construct(
$method,
$compNum,
$rsvp,
$method = null,
$compNum = null,
$rsvp = null,
$priority = null,
$name = null,
$loc = null,
Expand Down
21 changes: 15 additions & 6 deletions src/Zimbra/Mail/Struct/InviteComponentCommon.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ class InviteComponentCommon extends Base
* @param array $change
*/
public function __construct(
$method,
$compNum,
$rsvp,
$method = null,
$compNum = null,
$rsvp = null,
$priority = null,
$name = null,
$loc = null,
Expand Down Expand Up @@ -102,9 +102,18 @@ public function __construct(
)
{
parent::__construct();
$this->setProperty('method', trim($method));
$this->setProperty('compNum', (int) $compNum);
$this->setProperty('rsvp', (bool) $rsvp);
if(null !== $method)
{
$this->setProperty('method', trim($method));
}
if(null !== $compNum)
{
$this->setProperty('compNum', (int) $compNum);
}
if(null !== $rsvp)
{
$this->setProperty('rsvp', (bool) $rsvp);
}
if(null !== $priority)
{
$this->setProperty('priority', ((int) $priority > 0 or (int) $priority < 10) ? (int) $priority : 0);
Expand Down

0 comments on commit 6c3fa89

Please sign in to comment.