src/ORM/DataObject.php
public static function delete_by_id($className, $id)
    {
        $obj = DataObject::get_by_id($className, $id);
        if ($obj) {
            $obj->delete();
        } else {
            user_error("$className object #$id wasn't found when calling DataObject::delete_by_id", E_USER_WARNING);
        }
    }
public static function delete_by_id($className, $id)
    {
        $obj = DataObject::get_by_id($className, $id);
        if ($obj) {
            $obj->delete();
        } else {
            user_error("$className object #$id wasn't found when calling DataObject::delete_by_id", E_USER_WARNING);
        }
    }
public static function delete_by_id ( $ className , $ id ) { $ obj = DataObject :: get_by_id ( $ className , $ id ) ; if ( $ obj ) { $ obj -> delete ( ) ; } else { user_error ( "$className object #$id wasn't found when calling DataObject::delete_by_id" , E_USER_WARNING ) ; } }
Delete the record with the given ID.

@param string $className The class name of the record to be deleted
@param int $id ID of record to be deleted
Delete the record with the given ID .