summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Recipient/Group.php2
-rw-r--r--src/Recipient/ProcessedGroup.php15
2 files changed, 16 insertions, 1 deletions
diff --git a/src/Recipient/Group.php b/src/Recipient/Group.php
index a1d2d91..3c4ddd1 100644
--- a/src/Recipient/Group.php
+++ b/src/Recipient/Group.php
@@ -94,7 +94,7 @@ class Group implements \JsonSerializable
{
$returnArray = [
'Name' => $this->name,
- 'Color' => $this->Color,
+ 'Color' => $this->color,
];
return $returnArray;
}
diff --git a/src/Recipient/ProcessedGroup.php b/src/Recipient/ProcessedGroup.php
index d4bff44..102cd21 100644
--- a/src/Recipient/ProcessedGroup.php
+++ b/src/Recipient/ProcessedGroup.php
@@ -184,4 +184,19 @@ class ProcessedGroup extends Group implements UpdatableComponent, MembershipRela
}
return $this->updated ?? null;
}
+ /**
+ * Serializes the object to a value that can be serialized natively by json_encode().
+ * @return array Associative.
+ * @link http://php.net/manual/en/jsonserializable.jsonserialize.php
+ */
+ public function jsonSerialize(): array
+ {
+ $parentArray = parent::jsonSerialize();
+ $parentArray['Created'] = isset($this->created) ? $this->updated->format("Y-m-d\TH:i:s.").
+ substr($this->updated->format('u'), 0, 3) : null;
+ $parentArray['Updated'] = isset($this->created) ? $this->updated->format("Y-m-d\TH:i:s.").
+ substr($this->updated->format('u'), 0, 3) : null;
+ $parentArray['ID'] = $this->groupID;
+ return $parentArray;
+ }
}