[CORE][DB] DB:removeBy Accept class name instead of table.

This commit is contained in:
Diogo Peralta Cordeiro 2022-01-02 23:47:19 +00:00
parent b7574500f8
commit d27e8610d6
Signed by: diogo
GPG Key ID: 18D2D35001FBFAB0
1 changed files with 1 additions and 1 deletions

View File

@ -269,7 +269,7 @@ class DB
public static function removeBy(string $table, array $criteria): void
{
$class = self::$table_map[$table];
$class = self::$table_map[$table] ?? $table; // We're often already given the class's name
if (empty(array_intersect(self::getPKForClass($class), array_keys($criteria)))) {
self::remove(self::findOneBy($class, $criteria));
} else {