public function delete(): bool
    {
        if (! $this->exists())
        {
            return false;
        }

        $sql = 'DELETE FROM ' . $this->getTableName() . ' WHERE ' . $this->getKeyName() . ' = :key';
        $query = DB::getConnection()->prepare($sql);

        return $query->execute(['key' => $this->getKey()]);
    }
public function delete(): bool
    {
        if (! $this->exists())
        {
            return false;
        }

        $sql = 'DELETE FROM ' . $this->getTableName() . ' WHERE ' . $this->getKeyName() . ' = :key';
        $query = DB::getConnection()->prepare($sql);

        return $query->execute(['key' => $this->getKey()]);
    }
public function delete ( ) : bool { if ( ! $ this -> exists ( ) ) { return false ; } $ sql = 'DELETE FROM ' . $ this -> getTableName ( ) . ' WHERE ' . $ this -> getKeyName ( ) . ' = :key' ; $ query = DB :: getConnection ( ) -> prepare ( $ sql ) ; return $ query -> execute ( [ 'key' => $ this -> getKey ( ) ] ) ; }
Delete a model from the DB

@return bool
Delete a model from the DB