mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
DDC-3784: [GH-1434] convertToDatabaseValueSQL with $columnName #4640
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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 asUPDATE stock SET quantity = quantity+? WHERE id = ?;.I would like to accomplish this without using
DQLevery 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::updateTablenow passes the column name toDoctrine\DBAL\Types\Type::convertToDatabaseValueSQL(PR) to be used by the concrete type instance (ex.: mihai-stancu/doctrine-types-extra:\MS\Doctrine\DBAL\Types\DeltaType).@doctrinebot commented on GitHub (Jun 24, 2015):
Comment created by @doctrinebot:
A related Github Pull-Request [GH-1434] was closed:
https://github.com/doctrine/doctrine2/pull/1434