original_string: private function update($validate = true)
  	{
  		$this->verifyNotReadonly('update');
  
  		// Valid record?
  		if ($validate && !$this->_validate()) {
  			return false;
  		}
  
  		// Anything to update?
  		if ($this->isDirty()) {
  
  			// Check my primary key
  			$pk = $this->valuesForPk();
  			if (empty($pk)) {
  				throw new ActiveRecordException("Cannot update, no primary key defined for: " . get_called_class());
  			}
  
  			// Check callback
  			if (!$this->invokeCallback('beforeUpdate',false)) {
  				return false;
  			}
  
  			// Do the update
  			$dirty = $this->dirtyAttributes();
  			static::table()->update($dirty, $pk);
  			$this->invokeCallback('afterUpdate',false);
  		}
  
  		return true;
  	}
code: private function update($validate = true)
  	{
  		$this->verifyNotReadonly('update');
  
  		// Valid record?
  		if ($validate && !$this->_validate()) {
  			return false;
  		}
  
  		// Anything to update?
  		if ($this->isDirty()) {
  
  			// Check my primary key
  			$pk = $this->valuesForPk();
  			if (empty($pk)) {
  				throw new ActiveRecordException("Cannot update, no primary key defined for: " . get_called_class());
  			}
  
  			// Check callback
  			if (!$this->invokeCallback('beforeUpdate',false)) {
  				return false;
  			}
  
  			// Do the update
  			$dirty = $this->dirtyAttributes();
  			static::table()->update($dirty, $pk);
  			$this->invokeCallback('afterUpdate',false);
  		}
  
  		return true;
  	}
code_tokens: private function update ( $ validate = true ) { $ this -> verifyNotReadonly ( 'update' ) ; // Valid record? if ( $ validate && ! $ this -> _validate ( ) ) { return false ; } // Anything to update? if ( $ this -> isDirty ( ) ) { // Check my primary key $ pk = $ this -> valuesForPk ( ) ; if ( empty ( $ pk ) ) { throw new ActiveRecordException ( "Cannot update, no primary key defined for: " . get_called_class ( ) ) ; } // Check callback if ( ! $ this -> invokeCallback ( 'beforeUpdate' , false ) ) { return false ; } // Do the update $ dirty = $ this -> dirtyAttributes ( ) ; static :: table ( ) -> update ( $ dirty , $ pk ) ; $ this -> invokeCallback ( 'afterUpdate' , false ) ; } return true ; }
docstring: Issue an UPDATE sql statement for this model's dirty attributes.
  
  @see save
  @param boolean $validate Set to true or false depending on if you want the validators to run or not
  @return boolean True if the model was saved to the database otherwise false
docstring_tokens: Issue an UPDATE sql statement for this model s dirty attributes .