Exception in IdentifierFlattener::flattenIdentifier - column name used instead of field name in identifier extraction #5500

Closed
opened 2026-01-22 15:09:15 +01:00 by admin · 1 comment
Owner

Originally created by @tobiasstadler on GitHub (Apr 12, 2017).

Consider the following two entities:

class A
{
    /**
     * @Id 
     **/
    private $id;

    private $something;

    /**
     * @Version
     */
    private $version;
};

class B
{
	/**
	 * @Id
	 * @ManyToOne(targetEntity="A")
	 * @JoinColumn(name="aid", referencedColumnName="id)
	 */
	private $A
	
	private $something;
	
	/**
	 * @Version
	 */
	private $version
}

I get an Exception in IdentifierFlattener::flattenIdentifier called from BasicEntityPersister::fetchVersionValue because. BasicEntityPersister::fetchVersionValue calls IdentifierFlattener::flattenIdentifier with the identifier field name, but IdentifierFlattener::flattenIdentifier expects the identifier column names.

Originally created by @tobiasstadler on GitHub (Apr 12, 2017). Consider the following two entities: ``` class A { /** * @Id **/ private $id; private $something; /** * @Version */ private $version; }; class B { /** * @Id * @ManyToOne(targetEntity="A") * @JoinColumn(name="aid", referencedColumnName="id) */ private $A private $something; /** * @Version */ private $version } ```` I get an Exception in IdentifierFlattener::flattenIdentifier called from BasicEntityPersister::fetchVersionValue because. BasicEntityPersister::fetchVersionValue calls IdentifierFlattener::flattenIdentifier with the identifier field name, but IdentifierFlattener::flattenIdentifier expects the identifier column names.
admin added the Bug label 2026-01-22 15:09:15 +01:00
admin closed this issue 2026-01-22 15:09:15 +01:00
Author
Owner

@Ocramius commented on GitHub (Apr 12, 2017):

That should probably be changed to field names everywhere...

@Ocramius commented on GitHub (Apr 12, 2017): That should probably be changed to field names everywhere...
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#5500