From d27e8610d665325ef9d0c6d684ab68ccd584f78a Mon Sep 17 00:00:00 2001 From: Diogo Peralta Cordeiro Date: Sun, 2 Jan 2022 23:47:19 +0000 Subject: [PATCH] [CORE][DB] DB:removeBy Accept class name instead of table. --- src/Core/DB/DB.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Core/DB/DB.php b/src/Core/DB/DB.php index 873e1dc33f..aaaabcd445 100644 --- a/src/Core/DB/DB.php +++ b/src/Core/DB/DB.php @@ -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 {