createdAt = new \DateTimeImmutable('now'); } /** * Get module id. * * @return string * * @since 1.0.0 */ public function getId() : string { return $this->id; } /** * Get module status. * * @return int Module status * * @since 1.0.0 */ public function getStatus() : int { return $this->status; } /** * Set module status. * * @param int $status Module status * * @return void * * @throws InvalidEnumValue * * @since 1.0.0 */ public function setStatus(int $status) : void { if (!ModuleStatusUpdateType::isValidValue($status)) { throw new InvalidEnumValue($status); } $this->status = $status; } /** * Get string representation. * * @return string * * @since 1.0.0 */ public function __toString() { return (string) \json_encode($this->toArray()); } /** * {@inheritdoc} */ public function jsonSerialize() : mixed { return $this->toArray(); } /** * {@inheritdoc} */ public function toArray() : array { return [ 'id' => $this->id, 'name' => $this->name, 'path' => $this->path, 'version' => $this->version, 'status' => $this->status, 'createdAt' => $this->createdAt, ]; } }