DDC-832: Not quoted class name when updating entity #1028

Closed
opened 2026-01-22 12:59:19 +01:00 by admin · 6 comments
Owner

Originally created by @doctrinebot on GitHub (Oct 7, 2010).

Originally assigned to: @beberlei on GitHub.

Jira issue originally created by user needle:

When trying to update an entity which have a reserved name. Doctrine doesn't quoted its name.

On Doctrine\ORM\Persisters\BasicEntityPersister, _updateTable, $tableName is directly used to create the sql. We may use $this->_class->getQuotedTableName($this->_platform) instead ?

I'm going to propose a merge for that on github.

Originally created by @doctrinebot on GitHub (Oct 7, 2010). Originally assigned to: @beberlei on GitHub. Jira issue originally created by user needle: When trying to update an entity which have a reserved name. Doctrine doesn't quoted its name. On Doctrine\ORM\Persisters\BasicEntityPersister, _updateTable, $tableName is directly used to create the sql. We may use $this->_class->getQuotedTableName($this->_platform) instead ? I'm going to propose a merge for that on github.
admin added the Bug label 2026-01-22 12:59:19 +01:00
admin closed this issue 2026-01-22 12:59:20 +01:00
Author
Owner

@doctrinebot commented on GitHub (Oct 7, 2010):

@doctrinebot commented on GitHub (Oct 7, 2010): - relates to [DBAL-57: Handling of Quoted Elements](http://www.doctrine-project.org/jira/browse/DBAL-57)
Author
Owner

@doctrinebot commented on GitHub (Oct 8, 2010):

Comment created by needle:

Here is a test case

<?xml version="1.0" encoding="UTF-8"?>
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd">

    <entity name="Like" table="`like`">
        <id name="id" type="integer" column="id">
            <generator strategy="SEQUENCE"/>
            <sequence-generator sequence-name="like*id*seq" allocation-size="1" initial-value="1"/>
        </id>

        <field name="value" column="value" type="string" />
    </entity>
</doctrine-mapping>
CREATE TABLE "like"
(
  id serial NOT NULL,
  "value" character varying,
  CONSTRAINT like_pkey PRIMARY KEY (id)
);
class Like {

  private $id;
  public  $value;
}
$entity = new Like();
$entity->value = 'toto';

$doctrineEntityManager->persist($entity);
$doctrineEntityManager->flush();

$entity->value = 'tata';
$doctrineEntityManager->flush();
@doctrinebot commented on GitHub (Oct 8, 2010): Comment created by needle: Here is a test case ``` <?xml version="1.0" encoding="UTF-8"?> <doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> <entity name="Like" table="`like`"> <id name="id" type="integer" column="id"> <generator strategy="SEQUENCE"/> <sequence-generator sequence-name="like*id*seq" allocation-size="1" initial-value="1"/> </id> <field name="value" column="value" type="string" /> </entity> </doctrine-mapping> ``` ``` CREATE TABLE "like" ( id serial NOT NULL, "value" character varying, CONSTRAINT like_pkey PRIMARY KEY (id) ); ``` ``` class Like { private $id; public $value; } ``` ``` $entity = new Like(); $entity->value = 'toto'; $doctrineEntityManager->persist($entity); $doctrineEntityManager->flush(); $entity->value = 'tata'; $doctrineEntityManager->flush(); ```
Author
Owner

@doctrinebot commented on GitHub (Oct 30, 2010):

Comment created by @beberlei:

This issue partly depends on DBAL-57 (otherwise the testsuite keeps failing)

@doctrinebot commented on GitHub (Oct 30, 2010): Comment created by @beberlei: This issue partly depends on [DBAL-57](http://www.doctrine-project.org/jira/browse/DBAL-57) (otherwise the testsuite keeps failing)
Author
Owner

@doctrinebot commented on GitHub (Oct 30, 2010):

Comment created by @beberlei:

There is really no simple fix for this issue, your proposed one breaks joined table inheritance.

@doctrinebot commented on GitHub (Oct 30, 2010): Comment created by @beberlei: There is really no simple fix for this issue, your proposed one breaks joined table inheritance.
Author
Owner

@doctrinebot commented on GitHub (Oct 30, 2010):

Comment created by @beberlei:

Found a way! fixed.

@doctrinebot commented on GitHub (Oct 30, 2010): Comment created by @beberlei: Found a way! fixed.
Author
Owner

@doctrinebot commented on GitHub (Oct 30, 2010):

Issue was closed with resolution "Fixed"

@doctrinebot commented on GitHub (Oct 30, 2010): Issue was closed with resolution "Fixed"
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#1028