createdAt = new \DateTimeImmutable('now'); $this->createdBy = new NullAccount(); } /** * Get fields. * * @return array * * @since 1.0.0 */ public function getFields() : array { return $this->fields; } /** * Set fields. * * @param array $fields Exchange fields * * @return void * * @since 1.0.0 */ public function setFields(array $fields) : void { $this->fields = $fields; } /** * {@inheritdoc} */ public function toArray() : array { return [ 'id' => $this->id, 'message' => $this->message, 'type' => $this->type, 'fields' => $this->fields, 'createdAt' => $this->createdAt, ]; } /** * {@inheritdoc} */ public function jsonSerialize() : mixed { return $this->toArray(); } }