[CORE][DB] DB:removeBy Accept class name instead of table.
This commit is contained in:
parent
b7574500f8
commit
d27e8610d6
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user