protected function setDirty($attr = null)
    {
        if ($attr === null) {
            $this->setClean();
            foreach (array_keys(get_object_vars($this)) as $key) {
                $this->setDirty($key);
            }
        } elseif (
            !in_array($attr, $this->_dirtyAttr) &&
            !in_array($attr, $this->_readonlyAttr) &&
            substr($attr, 0, 1) != '_' &&
            $attr != 'id'
        ) {
            $this->_dirtyAttr[] = $attr;
        }
        return $this;
    }