original_string: protected function buildUpdateStatement($id,$data,$table=null) {
  		if (!$table) {
  			$table = $this->primaryTable;
  		}
  		$sql = "UPDATE {$table} SET ";
  		foreach ($data as $field=>$value) {
  			$sql .= "{$field}=:{$field},";
  			$bindparams[":{$field}"] = $value;
  		}
  		
  		$sql = rtrim($sql,',')." WHERE id=:id";
  		$bindparams[":id"] = $id;
  		if ($this->executeUpdate($sql,$bindparams)) {
  			return true;
  		}
  		return false;
  	}
code: protected function buildUpdateStatement($id,$data,$table=null) {
  		if (!$table) {
  			$table = $this->primaryTable;
  		}
  		$sql = "UPDATE {$table} SET ";
  		foreach ($data as $field=>$value) {
  			$sql .= "{$field}=:{$field},";
  			$bindparams[":{$field}"] = $value;
  		}
  		
  		$sql = rtrim($sql,',')." WHERE id=:id";
  		$bindparams[":id"] = $id;
  		if ($this->executeUpdate($sql,$bindparams)) {
  			return true;
  		}
  		return false;
  	}
code_tokens: protected function buildUpdateStatement ( $ id , $ data , $ table = null ) { if ( ! $ table ) { $ table = $ this -> primaryTable ; } $ sql = "UPDATE {$table} SET " ; foreach ( $ data as $ field => $ value ) { $ sql .= "{$field}=:{$field}," ; $ bindparams [ ":{$field}" ] = $ value ; } $ sql = rtrim ( $ sql , ',' ) . " WHERE id=:id" ; $ bindparams [ ":id" ] = $ id ; if ( $ this -> executeUpdate ( $ sql , $ bindparams ) ) { return true ; } return false ; }
docstring: Builds and executes an update statement
  @param int $id The id of the record to be updated
  @param mixed[] $data An associative array (ColumnName->Value) of data representing the updated data
  @param string $table Optional - The table to insert the new record into. Defaults to $primaryTable
  @return boolean True on success, false on failure
docstring_tokens: Builds and executes an update statement