. // }}} namespace Component\Conversation\Entity; use App\Core\Entity; use DateTimeInterface; /** * Entity class for ConversationsBlocks * * @category DB * @package GNUsocial * * @author Hugo Sales * @copyright 2022 Free Software Foundation, Inc http://www.fsf.org * @license https://www.gnu.org/licenses/agpl.html GNU AGPL v3 or later */ class ConversationBlock extends Entity { // {{{ Autocode // @codeCoverageIgnoreStart private int $conversation_id; private int $actor_id; private DateTimeInterface $created; public function setConversationId(int $conversation_id): self { $this->conversation_id = $conversation_id; return $this; } public function getConversationId(): int { return $this->conversation_id; } public function setActorId(int $actor_id): self { $this->actor_id = $actor_id; return $this; } public function getActorId(): int { return $this->actor_id; } public function setCreated(DateTimeInterface $created): self { $this->created = $created; return $this; } public function getCreated(): DateTimeInterface { return $this->created; } // @codeCoverageIgnoreEnd // }}} Autocode public static function schemaDef(): array { return [ 'name' => 'conversation_block', 'fields' => [ 'conversation_id' => ['type' => 'int', 'foreign key' => true, 'target' => 'Conversation.id', 'multiplicity' => 'one to one', 'not null' => true, 'description' => 'The conversation being blocked'], 'actor_id' => ['type' => 'int', 'foreign key' => true, 'target' => 'Actor.id', 'multiplicity' => 'one to one', 'not null' => true, 'description' => 'Who blocked the conversation'], 'created' => ['type' => 'datetime', 'not null' => true, 'default' => 'CURRENT_TIMESTAMP', 'description' => 'date this record was created'], ], 'primary key' => ['conversation_id', 'actor_id'], ]; } }