src/Base.php
public static function destroy($record)
    {
        if(is_string($record)) {
            return $record;
        }

        $id = $record->id;

        try {
            $tableName = self::getTableName();
            $conn = self::getConnection();
            $sql = "DELETE FROM ".$tableName ." WHERE id = ".$id;
            $affectedRows = $conn->exec($sql);

            return $affectedRows;
        }
        catch(PDOException $pe) {
            return $pe->getMessage();
        }
        catch(Exception $e) {
            return $e->getMessage();
        }
    }
public static function destroy($record)
    {
        if(is_string($record)) {
            return $record;
        }

        $id = $record->id;

        try {
            $tableName = self::getTableName();
            $conn = self::getConnection();
            $sql = "DELETE FROM ".$tableName ." WHERE id = ".$id;
            $affectedRows = $conn->exec($sql);

            return $affectedRows;
        }
        catch(PDOException $pe) {
            return $pe->getMessage();
        }
        catch(Exception $e) {
            return $e->getMessage();
        }
    }
public static function destroy ( $ record ) { if ( is_string ( $ record ) ) { return $ record ; } $ id = $ record -> id ; try { $ tableName = self :: getTableName ( ) ; $ conn = self :: getConnection ( ) ; $ sql = "DELETE FROM " . $ tableName . " WHERE id = " . $ id ; $ affectedRows = $ conn -> exec ( $ sql ) ; return $ affectedRows ; } catch ( PDOException $ pe ) { return $ pe -> getMessage ( ) ; } catch ( Exception $ e ) { return $ e -> getMessage ( ) ; } }
This method deletes a record from the database table
@param  integer $position
This method deletes a record from the database table