From 481027b09b2e6c64c9785835427750a1856cee06 Mon Sep 17 00:00:00 2001 From: Hugo Sales Date: Wed, 10 Mar 2021 17:20:42 +0000 Subject: [PATCH] [AUTOGENERATED][DB][File][GroupJoinQueue] Update autogenerated code and add select fields as specified in the previous commit --- components/Bridge/Entity/ForeignService.php | 1 - .../Bridge/Entity/ForeignSubscription.php | 1 - components/Bridge/Entity/ForeignUser.php | 1 - src/Entity/Activity.php | 6 ++-- src/Entity/File.php | 28 +++++++++++-------- src/Entity/GSActorTagFollow.php | 10 +++---- src/Entity/GroupJoinQueue.php | 17 ++--------- 7 files changed, 27 insertions(+), 37 deletions(-) diff --git a/components/Bridge/Entity/ForeignService.php b/components/Bridge/Entity/ForeignService.php index ac34077404..fbf04b1ee2 100644 --- a/components/Bridge/Entity/ForeignService.php +++ b/components/Bridge/Entity/ForeignService.php @@ -38,7 +38,6 @@ use DateTimeInterface; class ForeignService { // {{{ Autocode - private int $id; private string $name; private ?string $description; diff --git a/components/Bridge/Entity/ForeignSubscription.php b/components/Bridge/Entity/ForeignSubscription.php index d89bd76b75..f5f43a7099 100644 --- a/components/Bridge/Entity/ForeignSubscription.php +++ b/components/Bridge/Entity/ForeignSubscription.php @@ -38,7 +38,6 @@ use DateTimeInterface; class ForeignSubscription { // {{{ Autocode - private int $service; private int $subscriber; private int $subscribed; diff --git a/components/Bridge/Entity/ForeignUser.php b/components/Bridge/Entity/ForeignUser.php index 8bf91bc436..7d0b843bcb 100644 --- a/components/Bridge/Entity/ForeignUser.php +++ b/components/Bridge/Entity/ForeignUser.php @@ -38,7 +38,6 @@ use DateTimeInterface; class ForeignUser { // {{{ Autocode - private int $id; private int $service; private string $uri; diff --git a/src/Entity/Activity.php b/src/Entity/Activity.php index cba6894ca7..f2dc3b060c 100644 --- a/src/Entity/Activity.php +++ b/src/Entity/Activity.php @@ -44,7 +44,7 @@ class Activity extends Entity private string $object_type; private int $object_id; private bool $is_local; - private string $source; + private ?string $source; private DateTimeInterface $created; public function setId(int $id): self @@ -113,13 +113,13 @@ class Activity extends Entity return $this->is_local; } - public function setSource(string $source): self + public function setSource(?string $source): self { $this->source = $source; return $this; } - public function getSource(): string + public function getSource(): ?string { return $this->source; } diff --git a/src/Entity/File.php b/src/Entity/File.php index 99e1c0991f..bbabadcca0 100644 --- a/src/Entity/File.php +++ b/src/Entity/File.php @@ -42,14 +42,14 @@ use DateTimeInterface; class File extends Entity { // {{{ Autocode - private int $id; private ?string $url; private ?string $url_hash; private ?string $file_hash; - private ?int $actor_id; + private ?int $gsactor_id; private ?string $mimetype; private ?string $title; + private ?string $filename; private ?bool $is_local; private ?bool $is_nsfw; private ?bool $is_url_protected; @@ -99,15 +99,15 @@ class File extends Entity return $this->file_hash; } - public function setActorId(?int $actor_id): self + public function setGSActorId(?int $gsactor_id): self { - $this->actor_id = $actor_id; + $this->gsactor_id = $gsactor_id; return $this; } - public function getActorId(): ?int + public function getGSActorId(): ?int { - return $this->actor_id; + return $this->gsactor_id; } public function setMimetype(?string $mimetype): self @@ -132,6 +132,17 @@ class File extends Entity return $this->title; } + public function setFilename(?string $filename): self + { + $this->filename = $filename; + return $this; + } + + public function getFilename(): ?string + { + return $this->filename; + } + public function setIsLocal(?bool $is_local): self { $this->is_local = $is_local; @@ -181,11 +192,6 @@ class File extends Entity const URLHASH_ALGO = 'sha256'; const FILEHASH_ALGO = 'sha256'; - public function getFileName(): string - { - return $this->file_hash; - } - /** * Delete this file and by default all the associated entities (avatar and/or thumbnails, which this owns) */ diff --git a/src/Entity/GSActorTagFollow.php b/src/Entity/GSActorTagFollow.php index a04ad26d91..927d5e7d01 100644 --- a/src/Entity/GSActorTagFollow.php +++ b/src/Entity/GSActorTagFollow.php @@ -39,20 +39,20 @@ use DateTimeInterface; class GSActorTagFollow extends Entity { // {{{ Autocode - private int $gsactor_tag_id; + private int $gsactor_tag; private int $gsactor_id; private DateTimeInterface $created; private DateTimeInterface $modified; - public function setGSActorTagId(int $gsactor_tag_id): self + public function setGSActorTag(int $gsactor_tag): self { - $this->gsactor_tag_id = $gsactor_tag_id; + $this->gsactor_tag = $gsactor_tag; return $this; } - public function getGSActorTagId(): int + public function getGSActorTag(): int { - return $this->gsactor_tag_id; + return $this->gsactor_tag; } public function setGSActorId(int $gsactor_id): self diff --git a/src/Entity/GroupJoinQueue.php b/src/Entity/GroupJoinQueue.php index 9a06e732e3..36de8477d8 100644 --- a/src/Entity/GroupJoinQueue.php +++ b/src/Entity/GroupJoinQueue.php @@ -20,7 +20,6 @@ namespace App\Entity; use App\Core\Entity; -use DateTimeInterface; /** * Entity for Queue on joining a group @@ -41,7 +40,6 @@ class GroupJoinQueue extends Entity // {{{ Autocode private int $gsactor_id; private int $group_id; - private DateTimeInterface $created; public function setGSActorId(int $gsactor_id): self { @@ -65,17 +63,6 @@ class GroupJoinQueue extends Entity return $this->group_id; } - public function setCreated(DateTimeInterface $created): self - { - $this->created = $created; - return $this; - } - - public function getCreated(): DateTimeInterface - { - return $this->created; - } - // }}} Autocode public static function schemaDef(): array @@ -89,8 +76,8 @@ class GroupJoinQueue extends Entity ], 'primary key' => ['gsactor_id', 'group_id'], 'indexes' => [ - 'group_join_queue_gsactor_id_created_idx' => ['gsactor_id', 'created'], - 'group_join_queue_group_id_created_idx' => ['group_id', 'created'], + 'group_join_queue_gsactor_id_idx' => ['gsactor_id'], + 'group_join_queue_group_id_idx' => ['group_id'], ], ]; }