|
@@ 132-138 (lines=7) @@
|
| 129 |
|
if ($new === null && $mapping['nullable'] !== true) { |
| 130 |
|
$updateData['$unset'][$mapping['name']] = true; |
| 131 |
|
} else { |
| 132 |
|
if ($new !== null && isset($mapping['strategy']) && $mapping['strategy'] === ClassMetadataInfo::STORAGE_STRATEGY_INCREMENT) { |
| 133 |
|
$operator = '$inc'; |
| 134 |
|
$value = Type::getType($mapping['type'])->convertToDatabaseValue($new - $old); |
| 135 |
|
} else { |
| 136 |
|
$operator = '$set'; |
| 137 |
|
$value = $new === null ? null : Type::getType($mapping['type'])->convertToDatabaseValue($new); |
| 138 |
|
} |
| 139 |
|
|
| 140 |
|
$updateData[$operator][$mapping['name']] = $value; |
| 141 |
|
} |
|
@@ 230-236 (lines=7) @@
|
| 227 |
|
// Scalar fields |
| 228 |
|
if ( ! isset($mapping['association'])) { |
| 229 |
|
if ($new !== null || $mapping['nullable'] === true) { |
| 230 |
|
if ($new !== null && empty($mapping['id']) && isset($mapping['strategy']) && $mapping['strategy'] === ClassMetadataInfo::STORAGE_STRATEGY_INCREMENT) { |
| 231 |
|
$operator = '$inc'; |
| 232 |
|
$value = Type::getType($mapping['type'])->convertToDatabaseValue($new - $old); |
| 233 |
|
} else { |
| 234 |
|
$operator = '$set'; |
| 235 |
|
$value = $new === null ? null : Type::getType($mapping['type'])->convertToDatabaseValue($new); |
| 236 |
|
} |
| 237 |
|
|
| 238 |
|
$updateData[$operator][$mapping['name']] = $value; |
| 239 |
|
} |