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;
	}
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;
	}
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 ; }
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
Issue an UPDATE sql statement for this model s dirty attributes .