public function isModified($selector = null)
    {
        if (empty($this->modifiedFields)) {
            return false;
        }

        if (empty($selector)) {
            return (bool) $this->modifiedFields;
        }

        foreach ($this->modifiedFields as $modifiedField) {
            if (preg_match('/^' . $selector . '($|.)/', $modifiedField)) {
                return true;
            }
        }

        return false;
    }