[ENTITY][ActorTag][ActorTagBlock] Add 'use_canonical' column
This commit is contained in:
parent
9f445632b2
commit
259e07b259
@ -50,6 +50,7 @@ class ActorTag extends Entity
|
|||||||
private int $tagged;
|
private int $tagged;
|
||||||
private string $tag;
|
private string $tag;
|
||||||
private string $canonical;
|
private string $canonical;
|
||||||
|
private bool $use_canonical;
|
||||||
private DateTimeInterface $modified;
|
private DateTimeInterface $modified;
|
||||||
|
|
||||||
public function setTagger(int $tagger): self
|
public function setTagger(int $tagger): self
|
||||||
@ -96,6 +97,17 @@ class ActorTag extends Entity
|
|||||||
return $this->canonical;
|
return $this->canonical;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function setUseCanonical(bool $use_canonical): self
|
||||||
|
{
|
||||||
|
$this->use_canonical = $use_canonical;
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getUseCanonical(): bool
|
||||||
|
{
|
||||||
|
return $this->use_canonical;
|
||||||
|
}
|
||||||
|
|
||||||
public function setModified(DateTimeInterface $modified): self
|
public function setModified(DateTimeInterface $modified): self
|
||||||
{
|
{
|
||||||
$this->modified = $modified;
|
$this->modified = $modified;
|
||||||
@ -141,6 +153,7 @@ class ActorTag extends Entity
|
|||||||
'tagged' => ['type' => 'int', 'foreign key' => true, 'target' => 'Actor.id', 'multiplicity' => 'one to one', 'name' => 'actor_tag_tagged_fkey', 'not null' => true, 'description' => 'actor tagged'],
|
'tagged' => ['type' => 'int', 'foreign key' => true, 'target' => 'Actor.id', 'multiplicity' => 'one to one', 'name' => 'actor_tag_tagged_fkey', 'not null' => true, 'description' => 'actor tagged'],
|
||||||
'tag' => ['type' => 'varchar', 'length' => Tag::MAX_TAG_LENGTH, 'not null' => true, 'description' => 'hash tag associated with this actor'],
|
'tag' => ['type' => 'varchar', 'length' => Tag::MAX_TAG_LENGTH, 'not null' => true, 'description' => 'hash tag associated with this actor'],
|
||||||
'canonical' => ['type' => 'varchar', 'length' => Tag::MAX_TAG_LENGTH, 'not null' => true, 'description' => 'ascii slug of tag'],
|
'canonical' => ['type' => 'varchar', 'length' => Tag::MAX_TAG_LENGTH, 'not null' => true, 'description' => 'ascii slug of tag'],
|
||||||
|
'use_canonical' => ['type' => 'bool', 'not null' => true, 'description' => 'whether the user wanted to block canonical tags'],
|
||||||
'modified' => ['type' => 'timestamp', 'not null' => true, 'default' => 'CURRENT_TIMESTAMP', 'description' => 'date this record was modified'],
|
'modified' => ['type' => 'timestamp', 'not null' => true, 'default' => 'CURRENT_TIMESTAMP', 'description' => 'date this record was modified'],
|
||||||
],
|
],
|
||||||
'primary key' => ['tagger', 'tagged', 'canonical'],
|
'primary key' => ['tagger', 'tagged', 'canonical'],
|
||||||
@ -151,9 +164,4 @@ class ActorTag extends Entity
|
|||||||
],
|
],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function __toString()
|
|
||||||
{
|
|
||||||
return $this->getTag();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -45,6 +45,7 @@ class ActorTagBlock extends Entity
|
|||||||
private int $blocker;
|
private int $blocker;
|
||||||
private string $tag;
|
private string $tag;
|
||||||
private string $canonical;
|
private string $canonical;
|
||||||
|
private bool $use_canonical;
|
||||||
private DateTimeInterface $modified;
|
private DateTimeInterface $modified;
|
||||||
|
|
||||||
public function setBlocker(int $blocker): self
|
public function setBlocker(int $blocker): self
|
||||||
@ -80,6 +81,17 @@ class ActorTagBlock extends Entity
|
|||||||
return $this->canonical;
|
return $this->canonical;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function setUseCanonical(bool $use_canonical): self
|
||||||
|
{
|
||||||
|
$this->use_canonical = $use_canonical;
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getUseCanonical(): bool
|
||||||
|
{
|
||||||
|
return $this->use_canonical;
|
||||||
|
}
|
||||||
|
|
||||||
public function setModified(DateTimeInterface $modified): self
|
public function setModified(DateTimeInterface $modified): self
|
||||||
{
|
{
|
||||||
$this->modified = $modified;
|
$this->modified = $modified;
|
||||||
@ -121,6 +133,7 @@ class ActorTagBlock extends Entity
|
|||||||
'blocker' => ['type' => 'int', 'foreign key' => true, 'target' => 'Actor.id', 'multiplicity' => 'many to one', 'name' => 'actor_block_blocker_fkey', 'not null' => true, 'description' => 'user making the block'],
|
'blocker' => ['type' => 'int', 'foreign key' => true, 'target' => 'Actor.id', 'multiplicity' => 'many to one', 'name' => 'actor_block_blocker_fkey', 'not null' => true, 'description' => 'user making the block'],
|
||||||
'tag' => ['type' => 'varchar', 'length' => Tag::MAX_TAG_LENGTH, 'not null' => true, 'description' => 'hash tag this is blocking'],
|
'tag' => ['type' => 'varchar', 'length' => Tag::MAX_TAG_LENGTH, 'not null' => true, 'description' => 'hash tag this is blocking'],
|
||||||
'canonical' => ['type' => 'varchar', 'length' => Tag::MAX_TAG_LENGTH, 'foreign key' => true, 'target' => 'NoteTag.canonical', 'multiplicity' => 'many to one', 'not null' => true, 'description' => 'ascii slug of tag'],
|
'canonical' => ['type' => 'varchar', 'length' => Tag::MAX_TAG_LENGTH, 'foreign key' => true, 'target' => 'NoteTag.canonical', 'multiplicity' => 'many to one', 'not null' => true, 'description' => 'ascii slug of tag'],
|
||||||
|
'use_canonical' => ['type' => 'bool', 'not null' => true, 'description' => 'whether the user wanted to block canonical tags'],
|
||||||
'modified' => ['type' => 'timestamp', 'not null' => true, 'default' => 'CURRENT_TIMESTAMP', 'description' => 'date this record was modified'],
|
'modified' => ['type' => 'timestamp', 'not null' => true, 'default' => 'CURRENT_TIMESTAMP', 'description' => 'date this record was modified'],
|
||||||
],
|
],
|
||||||
'primary key' => ['blocker', 'canonical'],
|
'primary key' => ['blocker', 'canonical'],
|
||||||
|
Loading…
Reference in New Issue
Block a user