createdAt = new \DateTimeImmutable('now'); } /** * Get type. * * @return int * * @since 1.0.0 */ public function getType() : int { return $this->type; } /** * Set type. * * @param int $type Exchange type * * @return void * * @since 1.0.0 */ public function setType(int $type) : void { $this->type = $type; } /** * 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(); } }