Horde_Feed_Entry_Atom::delete PHP Method

delete() public method

Delete tries to delete this entry from its feed. If the entry does not contain a link rel="edit", we throw an error (either the entry does not yet exist or this is not an editable feed). If we have a link rel="edit", we do the empty-body HTTP DELETE to that URI and check for a response of 2xx. Usually the response would be 204 No Content, but the Atom Publishing Protocol permits it to be 200 OK.
public delete ( )
    public function delete()
    {
        // Look for link rel="edit" in the entry object.
        $deleteUri = $this->link('edit');
        if (!$deleteUri) {
            throw new Horde_Feed_Exception('Cannot delete entry; no link rel="edit" is present.');
        }
        // DELETE
        do {
            $response = $this->_httpClient->delete($deleteUri);
            switch ((int) $response->code / 100) {
                // Success
                case 2:
                    return true;
                    // Redirect
                // Redirect
                case 3:
                    $deleteUri = $response->getHeader('Location');
                    continue;
                    // Error
                // Error
                default:
                    throw new Horde_Feed_Exception('Expected response code 2xx, got ' . $response->code);
            }
        } while (true);
    }
Horde_Feed_Entry_Atom