[CORE][DB][ENTITY][Actor] Add `DB::removeBy` and use it in `Actor->setSelfTags`
This commit is contained in:
parent
66ff3c594d
commit
fc81f7301c
|
@ -224,6 +224,11 @@ class DB
|
|||
}
|
||||
}
|
||||
|
||||
public static function removeBy(string $table, array $criteria)
|
||||
{
|
||||
self::remove(self::getReference($table, $criteria));
|
||||
}
|
||||
|
||||
public static function count(string $table, array $criteria)
|
||||
{
|
||||
/** @var EntityRepository */
|
||||
|
|
|
@ -365,8 +365,7 @@ class Actor extends Entity
|
|||
$actor_tag = DB::findOneBy('actor_tag', ['tagger' => $this->getId(), 'tagged' => $this->getId(), 'tag' => $actor_circle->getTag()]);
|
||||
DB::persist($actor_tag);
|
||||
DB::remove($actor_tag);
|
||||
// TODO: use DB::removeBy when implemented
|
||||
DB::remove(DB::getReference('actor_circle', ['id' => $actor_circle->getId()]));
|
||||
DB::removeBy('actor_circle', ['id' => $actor_circle->getId()]);
|
||||
}
|
||||
Cache::delete("selftags-{$this->getId()}");
|
||||
Cache::delete("othertags-{$this->getId()}-by-{$this->getId()}");
|
||||
|
|
Loading…
Reference in New Issue