public function isDirty()
    {
        if (
            !empty($this->_dirtyAttr) ||
            (($this instanceof DeleteBySaving) && $this->isDeleted())
        ) {
            return true;
        }

        foreach (array_keys(get_object_vars($this)) as $key) {
            foreach ((array) $this->$key as $sub) {
                if (($sub instanceof DirtyAware) && $sub->isDirty()) {
                    return true;
                }
            }
        }
        return false;
    }