public function getChangedFields()
    {
        if ($this->_snapshot === false) {
            throw new PreconditionException(['getChangedFields failed: `:model` instance is snapshot disabled', 'model' => static::class]);
        }

        $changed = [];

        foreach ($this->getFields() as $field) {
            if (isset($this->_snapshot[$field])) {
                if ($this->{$field} !== $this->_snapshot[$field]) {
                    $changed[] = $field;
                }
            } elseif ($this->$field !== null) {
                $changed[] = $field;
            }
        }

        return $changed;
    }
public function getChangedFields()
    {
        if ($this->_snapshot === false) {
            throw new PreconditionException(['getChangedFields failed: `:model` instance is snapshot disabled', 'model' => static::class]);
        }

        $changed = [];

        foreach ($this->getFields() as $field) {
            if (isset($this->_snapshot[$field])) {
                if ($this->{$field} !== $this->_snapshot[$field]) {
                    $changed[] = $field;
                }
            } elseif ($this->$field !== null) {
                $changed[] = $field;
            }
        }

        return $changed;
    }
public function getChangedFields ( ) { if ( $ this -> _snapshot === false ) { throw new PreconditionException ( [ 'getChangedFields failed: `:model` instance is snapshot disabled' , 'model' => static :: class ] ) ; } $ changed = [ ] ; foreach ( $ this -> getFields ( ) as $ field ) { if ( isset ( $ this -> _snapshot [ $ field ] ) ) { if ( $ this -> { $ field } !== $ this -> _snapshot [ $ field ] ) { $ changed [ ] = $ field ; } } elseif ( $ this -> $ field !== null ) { $ changed [ ] = $ field ; } } return $ changed ; }
Returns a list of changed values

@return array
Returns a list of changed values