public function getUpdateSql($fieldsToUpdate)
    {
        $sql = "UPDATE `".$this->schemaName."` AS `".$this->getAlias()."`";

        foreach($this->joins as $join){
            $sql .= " ".$join->joinType." (".$join->getSql($this).") AS `".$join->statement->getAlias()."` ON `".$this->getAlias()."`.`".
                $join->parentColumn."` = `".$join->statement->getAlias()."`.`".$join->childColumn."`";
        }

        $sets = [];

        foreach ($fieldsToUpdate as $key) {
            $paramName = "Update" . $key;

            $sets[] = "`".$this->getAlias()."`.`" . $key . "` = :" . $paramName;
        }

        $sql .= " SET ".implode(",", $sets);

        if ($this->whereExpression) {
            $sql .= " WHERE ".$this->whereExpression->getWhereSql($this);
        }

        return $sql;
    }
public function getUpdateSql($fieldsToUpdate)
    {
        $sql = "UPDATE `".$this->schemaName."` AS `".$this->getAlias()."`";

        foreach($this->joins as $join){
            $sql .= " ".$join->joinType." (".$join->getSql($this).") AS `".$join->statement->getAlias()."` ON `".$this->getAlias()."`.`".
                $join->parentColumn."` = `".$join->statement->getAlias()."`.`".$join->childColumn."`";
        }

        $sets = [];

        foreach ($fieldsToUpdate as $key) {
            $paramName = "Update" . $key;

            $sets[] = "`".$this->getAlias()."`.`" . $key . "` = :" . $paramName;
        }

        $sql .= " SET ".implode(",", $sets);

        if ($this->whereExpression) {
            $sql .= " WHERE ".$this->whereExpression->getWhereSql($this);
        }

        return $sql;
    }
public function getUpdateSql ( $ fieldsToUpdate ) { $ sql = "UPDATE `" . $ this -> schemaName . "` AS `" . $ this -> getAlias ( ) . "`" ; foreach ( $ this -> joins as $ join ) { $ sql .= " " . $ join -> joinType . " (" . $ join -> getSql ( $ this ) . ") AS `" . $ join -> statement -> getAlias ( ) . "` ON `" . $ this -> getAlias ( ) . "`.`" . $ join -> parentColumn . "` = `" . $ join -> statement -> getAlias ( ) . "`.`" . $ join -> childColumn . "`" ; } $ sets = [ ] ; foreach ( $ fieldsToUpdate as $ key ) { $ paramName = "Update" . $ key ; $ sets [ ] = "`" . $ this -> getAlias ( ) . "`.`" . $ key . "` = :" . $ paramName ; } $ sql .= " SET " . implode ( "," , $ sets ) ; if ( $ this -> whereExpression ) { $ sql .= " WHERE " . $ this -> whereExpression -> getWhereSql ( $ this ) ; } return $ sql ; }
Returns an UPDATE statement using the supplied key value pairings to update.

Inserts named parameters using the field name but prefixed with "Update"

e.g. updating "Forename" should be matched with a named parameter when executing the query of "UpdateForename"

@param $fieldsToUpdate
@return string
Returns an UPDATE statement using the supplied key value pairings to update .