public function delete()
    {
        // Delete object in Zammad.
        $object_id = $this->getID();
        if ( !empty($object_id) ) {
            $url = $this->getURL(
                'delete',
                [
                    'object_id' => $object_id,
                ]
            );

            $response = $this->getClient()->delete(
                $url,
                [
                    'expand' => true,
                ]
            );
            if ( $response->hasError() ) {
                $this->setError( $response->getError() );
                return $this;
            }
        }

        // Clear data of this (local) object.
        $this->clearError();
        $this->clearRemoteData();
        $this->clearUnsavedValues();

        return $this;
    }
public function delete()
    {
        // Delete object in Zammad.
        $object_id = $this->getID();
        if ( !empty($object_id) ) {
            $url = $this->getURL(
                'delete',
                [
                    'object_id' => $object_id,
                ]
            );

            $response = $this->getClient()->delete(
                $url,
                [
                    'expand' => true,
                ]
            );
            if ( $response->hasError() ) {
                $this->setError( $response->getError() );
                return $this;
            }
        }

        // Clear data of this (local) object.
        $this->clearError();
        $this->clearRemoteData();
        $this->clearUnsavedValues();

        return $this;
    }
public function delete ( ) { // Delete object in Zammad. $ object_id = $ this -> getID ( ) ; if ( ! empty ( $ object_id ) ) { $ url = $ this -> getURL ( 'delete' , [ 'object_id' => $ object_id , ] ) ; $ response = $ this -> getClient ( ) -> delete ( $ url , [ 'expand' => true , ] ) ; if ( $ response -> hasError ( ) ) { $ this -> setError ( $ response -> getError ( ) ) ; return $ this ; } } // Clear data of this (local) object. $ this -> clearError ( ) ; $ this -> clearRemoteData ( ) ; $ this -> clearUnsavedValues ( ) ; return $ this ; }
Deletes the data of this object.
If data contains an ID, the object will also be deleted in Zammad.

@return object      This object
Deletes the data of this object . If data contains an ID the object will also be deleted in Zammad .