summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorHannes Kindströmmer <hannes@kindstrommer.se>2017-03-20 17:14:09 +0100
committerHannes Kindströmmer <hannes@kindstrommer.se>2017-03-21 11:35:45 +0100
commite3f2ed7d4ac64d23983739c90c97d7bee8df4dd3 (patch)
tree1198c067b78d2af0fda3f5ef3c759dea1d7ba6c9 /src
parent4f88e25a0c9bef08cea2af20de84cb6ffb2ad416 (diff)
downloadip1-php-sdk-e3f2ed7d4ac64d23983739c90c97d7bee8df4dd3.zip
ip1-php-sdk-e3f2ed7d4ac64d23983739c90c97d7bee8df4dd3.tar.gz
ip1-php-sdk-e3f2ed7d4ac64d23983739c90c97d7bee8df4dd3.tar.bz2
Implement OwnerID into Group
Signed-off-by: Hannes Kindströmmer <hannes@kindstrommer.se>
Diffstat (limited to 'src')
-rw-r--r--src/Recipient/ProcessedGroup.php30
-rw-r--r--src/Recipient/RecipientFactory.php1
2 files changed, 27 insertions, 4 deletions
diff --git a/src/Recipient/ProcessedGroup.php b/src/Recipient/ProcessedGroup.php
index 48e8605..8840bd3 100644
--- a/src/Recipient/ProcessedGroup.php
+++ b/src/Recipient/ProcessedGroup.php
@@ -37,6 +37,11 @@ class ProcessedGroup extends Group implements UpdatableComponentInterface, Membe
*/
private $updated;
/**
+ * ID of account owning the Group
+ * @var string $ownerID
+ */
+ private $ownerID;
+ /**
* An array of memberships that the Group has.
*
* It is empty by default but is filled when the function getMemberships() is called if a Communicator is given
@@ -66,30 +71,47 @@ class ProcessedGroup extends Group implements UpdatableComponentInterface, Membe
protected $contactsFetched = false;
const IS_READ_ONLY = false;
/**
- * ProcessedGroup Contstructor
+ * ProcessedGroup Contstructor.
* @param string $name Name of the Group.
* @param string $color A hexadecimal color.
* @param integer $groupID An ID generated by the API.
+ * @param string $ownerID ID of account owning the Group.
* @param \DateTime $created When the Group was initially created.
* @param \DateTime $updated When the Group was last updated.
*/
- public function __construct(string $name, string $color, int $groupID, \DateTime $created, \DateTime $updated)
- {
+ public function __construct(
+ string $name,
+ string $color,
+ int $groupID,
+ string $ownerID,
+ \DateTime $created,
+ \DateTime $updated
+ ) {
+
parent::__construct($name, $color);
$this->groupID = $groupID;
+ $this->ownerID = $ownerID;
$this->created = $created;
$this->updated = $updated;
$this->memberships = new ClassValidationArray();
$this->contacts = new ClassValidationArray();
}
/**
- * @return integer Group ID
+ * @return integer Group ID.
*/
public function getID(): int
{
return $this->groupID;
}
/**
+ * Returns ID of account owning the Group.
+ * @return string
+ */
+ public function getOwnerID(): string
+ {
+ return $this->ownerID;
+ }
+ /**
* Returns whether the object is read only or not.
* @return boolean Whether the object is read only or not.
*/
diff --git a/src/Recipient/RecipientFactory.php b/src/Recipient/RecipientFactory.php
index 918d2ee..3fffe39 100644
--- a/src/Recipient/RecipientFactory.php
+++ b/src/Recipient/RecipientFactory.php
@@ -156,6 +156,7 @@ class RecipientFactory
$stdGroup->Name,
$stdGroup->Color,
$stdGroup->ID,
+ $stdGroup->OwnerID,
new \DateTime($stdGroup->Created),
new \DateTime($stdGroup->Modified)
);