original_string: 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;
      }
code: 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;
      }
code_tokens: 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 ; }
docstring: Checks whether the model changes
  
  @return bool
docstring_tokens: Checks whether the model changes