. // }}} namespace App\Entity; use App\Core\Entity; use DateTimeInterface; /** * Entity for Notice Tag * * @category DB * @package GNUsocial * * @author Zach Copley * @copyright 2010 StatusNet Inc. * @author Mikael Nordfeldth * @copyright 2009-2014 Free Software Foundation, Inc http://www.fsf.org * @author Hugo Sales * @copyright 2020-2021 Free Software Foundation, Inc http://www.fsf.org * @license https://www.gnu.org/licenses/agpl.html GNU AGPL v3 or later */ class NoteHashtag extends Entity { // {{{ Autocode private string $tag; private int $note_id; private DateTimeInterface $created; public function setTag(string $tag): self { $this->tag = $tag; return $this; } public function getTag(): string { return $this->tag; } public function setNoteId(int $note_id): self { $this->note_id = $note_id; return $this; } public function getNoteId(): int { return $this->note_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 { return [ 'name' => 'note_hashtag', 'description' => 'Hash tags on notes', 'fields' => [ 'tag' => ['type' => 'varchar', 'length' => 64, 'not null' => true, 'description' => 'hash tag associated with this note'], 'note_id' => ['type' => 'int', 'not null' => true, 'description' => 'foreign key to tagged note'], 'created' => ['type' => 'datetime', 'not null' => true, 'default' => 'CURRENT_TIMESTAMP', 'description' => 'date this record was modified'], ], 'primary key' => ['tag', 'note_id'], 'foreign keys' => [ 'note_hashtag_note_id_fkey' => ['note', ['note_id' => 'id']], ], 'indexes' => [ 'note_tag_created_idx' => ['created'], 'note_tag_note_id_idx' => ['note_id'], 'note_tag_tag_created_note_id_idx' => ['tag', 'created', 'note_id'], ], ]; } }