File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ class File extends Entity {
5353 protected string $ uuid = '' ;
5454 protected ?\DateTime $ createdAt = null ;
5555 protected string $ name = '' ;
56- protected ?int $ status = null ;
56+ protected ?int $ status = FileStatus:: DRAFT -> value ;
5757 protected ?string $ userId = null ;
5858 protected ?int $ signedNodeId = null ;
5959 protected ?string $ signedHash = null ;
@@ -100,7 +100,20 @@ public function getUserId(): string {
100100 }
101101
102102 public function getStatusEnum (): FileStatus {
103- return FileStatus::from ($ this ->status ?? FileStatus::DRAFT ->value );
103+ return FileStatus::from ($ this ->getStatus ());
104+ }
105+
106+ public function getStatus (): int {
107+ return $ this ->status ?? FileStatus::DRAFT ->value ;
108+ }
109+
110+ public function setStatus (int $ status ): void {
111+ if (FileStatus::tryFrom ($ status ) === null ) {
112+ throw new \InvalidArgumentException (sprintf ('Invalid file status code: %d ' , $ status ));
113+ }
114+
115+ $ this ->status = $ status ;
116+ $ this ->markFieldUpdated ('status ' );
104117 }
105118
106119 public function setStatusEnum (FileStatus $ status ): void {
You can’t perform that action at this time.
0 commit comments