Ouzo\Db\Dialect\DialectUtil::buildAttributesPartForUpdate PHP Method

buildAttributesPartForUpdate() public static method

public static buildAttributesPartForUpdate ( $updateAttributes )
    public static function buildAttributesPartForUpdate($updateAttributes)
    {
        return Joiner::on(', ')->join(FluentArray::from($updateAttributes)->keys()->map(function ($column) {
            return "{$column} = ?";
        })->toArray());
    }

Usage Example

Example #1
0
 public function update()
 {
     $attributes = DialectUtil::buildAttributesPartForUpdate($this->_query->updateAttributes);
     $table = $this->table();
     return "UPDATE {$table} SET {$attributes}";
 }