src/Mvc/Model.php
public function isChanged()
    {
        $snapshot = $this->_snapshot;
        if (!is_array($snapshot)) {
            return true;
        }
        $metadata = $this->getModelsMetaData();
        $attrs = $metadata->getNonPrimaryKeyAttributes($this);
        $automatic = $metadata->getAutomaticUpdateAttributes($this);
        $bindDataTypes = $metadata->getBindTypes($this);
        foreach ($attrs as $name) {
            if (isset($automatic[$name])) {
                continue;
            }
            $value = $this->readAttribute($name);
            $snapshotValue = ArrayHelper::fetch($snapshot, $name);
            if ($value === null) {
                if ($snapshotValue !== null) {
                    return true;
                }
            } else {
                if ($snapshotValue === null) {
                    return true;
                }
                $bindType = ArrayHelper::fetch($bindDataTypes, $name);
                switch ($bindType) {
                    case Column::TYPE_DATE:
                    case Column::TYPE_VARCHAR:
                    case Column::TYPE_DATETIME:
                    case Column::TYPE_CHAR:
                    case Column::TYPE_TEXT:
                    case Column::TYPE_VARCHAR:
                    case Column::TYPE_BIGINTEGER:
                        if (((string)$value) !== ((string)$snapshotValue)) {
                            return true;
                        }
                        break;
                    default:
                        if ($value != $snapshotValue) {
                            return true;
                        }
                }
            }
        }
        return false;
    }
public function isChanged()
    {
        $snapshot = $this->_snapshot;
        if (!is_array($snapshot)) {
            return true;
        }
        $metadata = $this->getModelsMetaData();
        $attrs = $metadata->getNonPrimaryKeyAttributes($this);
        $automatic = $metadata->getAutomaticUpdateAttributes($this);
        $bindDataTypes = $metadata->getBindTypes($this);
        foreach ($attrs as $name) {
            if (isset($automatic[$name])) {
                continue;
            }
            $value = $this->readAttribute($name);
            $snapshotValue = ArrayHelper::fetch($snapshot, $name);
            if ($value === null) {
                if ($snapshotValue !== null) {
                    return true;
                }
            } else {
                if ($snapshotValue === null) {
                    return true;
                }
                $bindType = ArrayHelper::fetch($bindDataTypes, $name);
                switch ($bindType) {
                    case Column::TYPE_DATE:
                    case Column::TYPE_VARCHAR:
                    case Column::TYPE_DATETIME:
                    case Column::TYPE_CHAR:
                    case Column::TYPE_TEXT:
                    case Column::TYPE_VARCHAR:
                    case Column::TYPE_BIGINTEGER:
                        if (((string)$value) !== ((string)$snapshotValue)) {
                            return true;
                        }
                        break;
                    default:
                        if ($value != $snapshotValue) {
                            return true;
                        }
                }
            }
        }
        return false;
    }
public function isChanged ( ) { $ snapshot = $ this -> _snapshot ; if ( ! is_array ( $ snapshot ) ) { return true ; } $ metadata = $ this -> getModelsMetaData ( ) ; $ attrs = $ metadata -> getNonPrimaryKeyAttributes ( $ this ) ; $ automatic = $ metadata -> getAutomaticUpdateAttributes ( $ this ) ; $ bindDataTypes = $ metadata -> getBindTypes ( $ this ) ; foreach ( $ attrs as $ name ) { if ( isset ( $ automatic [ $ name ] ) ) { continue ; } $ value = $ this -> readAttribute ( $ name ) ; $ snapshotValue = ArrayHelper :: fetch ( $ snapshot , $ name ) ; if ( $ value === null ) { if ( $ snapshotValue !== null ) { return true ; } } else { if ( $ snapshotValue === null ) { return true ; } $ bindType = ArrayHelper :: fetch ( $ bindDataTypes , $ name ) ; switch ( $ bindType ) { case Column :: TYPE_DATE : case Column :: TYPE_VARCHAR : case Column :: TYPE_DATETIME : case Column :: TYPE_CHAR : case Column :: TYPE_TEXT : case Column :: TYPE_VARCHAR : case Column :: TYPE_BIGINTEGER : if ( ( ( string ) $ value ) !== ( ( string ) $ snapshotValue ) ) { return true ; } break ; default : if ( $ value != $ snapshotValue ) { return true ; } } } } return false ; }
Checks whether the model changes

@return bool
Checks whether the model changes