public function isDirty() {

    // If there is no content, the object can't be dirty.
    if (!isset($this->content)) {
      return FALSE;
    }

    // Content is dirty iff content is set, and it is
    // different from the original content. Note that
    // we are using the etag from the original headers.
    if ($this->etag != md5($this->content)) {
      return TRUE;
    }

    return FALSE;
  }
public function isDirty() {

    // If there is no content, the object can't be dirty.
    if (!isset($this->content)) {
      return FALSE;
    }

    // Content is dirty iff content is set, and it is
    // different from the original content. Note that
    // we are using the etag from the original headers.
    if ($this->etag != md5($this->content)) {
      return TRUE;
    }

    return FALSE;
  }
public function isDirty ( ) { // If there is no content, the object can't be dirty. if ( ! isset ( $ this -> content ) ) { return FALSE ; } // Content is dirty iff content is set, and it is // different from the original content. Note that // we are using the etag from the original headers. if ( $ this -> etag != md5 ( $ this -> content ) ) { return TRUE ; } return FALSE ; }
Check whether there are unsaved changes.

An object is marked "dirty" if it has been altered
locally in such a way that it no longer matches the
remote version.

The practical definition of dirtiness, for us, is this: An object
is dirty if and only if (a) it has locally buffered content AND (b)
the checksum of the local content does not match the checksom of
the remote content.

Not that minor differences, such as altered character encoding, may
change the checksum value, and thus (correctly) mark the object as
dirty.

The RemoteObject implementation does not internally check dirty
markers. It is left to implementors to ensure that dirty content is
written to the remote server when desired.

To replace dirty content with a clean copy, see refresh().
Check whether there are unsaved changes .