diff --git a/src/Core/Entity.php b/src/Core/Entity.php index d221881427..50e39621c1 100644 --- a/src/Core/Entity.php +++ b/src/Core/Entity.php @@ -48,4 +48,13 @@ class Entity $table = Formatting::camelCaseToSnakeCase(get_called_class()); return self::create($args, DB::findBy($table, $find_by)[0]); } + + public static function remove(array $args, $obj = null) + { + $class = '\\' . get_called_class(); + if ($obj == null) { + $obj = DB::findBy($class, $args); + } + DB::remove($obj); + } }