private function valueChanged() { if ($this->field instanceof DbField && !$this->field->hasRow()) { return false; } $newValue = $this->field->getValue(); if (is_array($this->originalValue) && is_array($newValue)) { $intersection = count(array_intersect($this->originalValue, $newValue)); return count($this->originalValue) !== $intersection || count($newValue) !== $intersection; } else { return $this->originalValue !== $newValue; } }