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 id * * @return int * * @since 1.0.0 */ public function getId() : int { return $this->id; } /** * @return string * * @since 1.0.0 */ public function getMessage() : string { return $this->message; } /** * Set message * * @param string $message Log message * * @return void * * @since 1.0.0 */ public function setMessage(string $message) : void { $this->message = $message; } /** * 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, 'datetime' => $this->createdAt, ]; } /** * {@inheritdoc} */ public function jsonSerialize() { return $this->toArray(); } }