File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change 1515use OCP \DB \Types ;
1616use OCP \Files \IMimeTypeDetector ;
1717use OCP \Server ;
18- use Override ;
1918
2019/**
2120 * Preview entity mapped to the oc_previews and oc_preview_locations table.
@@ -81,6 +80,7 @@ class Preview extends Entity {
8180 protected ?bool $ encrypted = null ;
8281
8382 public function __construct () {
83+ $ this ->addType ('id ' , Types::STRING );
8484 $ this ->addType ('fileId ' , Types::BIGINT );
8585 $ this ->addType ('storageId ' , Types::BIGINT );
8686 $ this ->addType ('oldFileId ' , Types::BIGINT );
@@ -96,8 +96,7 @@ public function __construct() {
9696 $ this ->addType ('encrypted ' , Types::BOOLEAN );
9797 $ this ->addType ('etag ' , Types::STRING );
9898 $ this ->addType ('versionId ' , Types::STRING );
99- $ this ->id = Server::get (ISnowflake::class)->nextId ();
100- $ this ->markFieldUpdated ('id ' );
99+ $ this ->setId (Server::get (ISnowflake::class)->nextId ());
101100 }
102101
103102 public static function fromPath (string $ path , IMimeTypeDetector $ mimeTypeDetector ): Preview |false {
Original file line number Diff line number Diff line change 1919 * @psalm-consistent-constructor
2020 */
2121abstract class Entity {
22- public int |string |null $ id = null ;
22+ /** @var int $id */
23+ public $ id = null ;
2324
2425 private array $ _updatedFields = [];
2526 /** @var array<string, \OCP\DB\Types::*> */
You can’t perform that action at this time.
0 commit comments