public function delete($id, $filter = null)
    {
        if (empty($id)) {
            throw new StorageException('Invalid id parameter.');
        }

        if (!$filter) {
            $filter = [];
        }

        $filter[self::DIAGNOSTIC_ID] = $id;

        try {
            \common_Logger::i('Deleting diagnostic result ' . $id);
            $query = 'DELETE FROM ' . self::DIAGNOSTIC_TABLE;
            return (boolean) $this->query($query, $filter)->rowCount();
        } catch (\PDOException $e) {
            throw new StorageException($e->getMessage());
        }
    }
public function delete($id, $filter = null)
    {
        if (empty($id)) {
            throw new StorageException('Invalid id parameter.');
        }

        if (!$filter) {
            $filter = [];
        }

        $filter[self::DIAGNOSTIC_ID] = $id;

        try {
            \common_Logger::i('Deleting diagnostic result ' . $id);
            $query = 'DELETE FROM ' . self::DIAGNOSTIC_TABLE;
            return (boolean) $this->query($query, $filter)->rowCount();
        } catch (\PDOException $e) {
            throw new StorageException($e->getMessage());
        }
    }
public function delete ( $ id , $ filter = null ) { if ( empty ( $ id ) ) { throw new StorageException ( 'Invalid id parameter.' ) ; } if ( ! $ filter ) { $ filter = [ ] ; } $ filter [ self :: DIAGNOSTIC_ID ] = $ id ; try { \ common_Logger :: i ( 'Deleting diagnostic result ' . $ id ) ; $ query = 'DELETE FROM ' . self :: DIAGNOSTIC_TABLE ; return ( boolean ) $ this -> query ( $ query , $ filter ) -> rowCount ( ) ; } catch ( \ PDOException $ e ) { throw new StorageException ( $ e -> getMessage ( ) ) ; } }
Deletes a row from the storage model based on entity
@param $id
@param array $filter A list of filters (pairs columns => value)
@return bool
@throws StorageException
Deletes a row from the storage model based on entity