DDC-3784: [GH-1434] convertToDatabaseValueSQL with $columnName #4639

Open
opened 2026-01-22 14:46:23 +01:00 by admin · 0 comments
Owner

Originally created by @doctrinebot on GitHub (Jun 21, 2015).

Originally assigned to: @beberlei on GitHub.

Jira issue originally created by user @doctrinebot:

This issue is created automatically through a Github pull request on behalf of mihai-stancu:

Url: https://github.com/doctrine/doctrine2/pull/1434

Message:

Goal:

I want to be able to atomically increment a property such that $stock->setQuantityDelta(2); will render into an SQL such as UPDATE stock SET quantity = quantity+? WHERE id = ?;.

I would like to accomplish this without using DQL every time it is necessary hence I implemented a custom Doctrine2 type which can accomplish this -- with support from this PR.

Changes:

\Doctrine\ORM\Persisters\BasicEntityPersister::updateTable now passes the column name to Doctrine\DBAL\Types\Type::convertToDatabaseValueSQL (PR) to be used by the concrete type instance (ex.: mihai-stancu/doctrine-types-extra:\MS\Doctrine\DBAL\Types\DeltaType).

Originally created by @doctrinebot on GitHub (Jun 21, 2015). Originally assigned to: @beberlei on GitHub. Jira issue originally created by user @doctrinebot: This issue is created automatically through a Github pull request on behalf of mihai-stancu: Url: https://github.com/doctrine/doctrine2/pull/1434 Message: #### Goal: I want to be able to atomically increment a property such that `$stock->setQuantityDelta(2);` will render into an SQL such as `UPDATE stock SET quantity = quantity+? WHERE id = ?;`. I would like to accomplish this without using `DQL` every time it is necessary hence I implemented a custom Doctrine2 type which can accomplish this -- with support from this PR. #### Changes: `\Doctrine\ORM\Persisters\BasicEntityPersister::updateTable` now passes the column name to `Doctrine\DBAL\Types\Type::convertToDatabaseValueSQL` ([PR](https://github.com/doctrine/dbal/pull/874)) to be used by the concrete type instance (ex.: **mihai-stancu/doctrine-types-extra**:`\MS\Doctrine\DBAL\Types\DeltaType`).
admin added the Bug label 2026-01-22 14:46:23 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#4639