Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Embedded identifier support#16826

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
mihai-stancu wants to merge1 commit intosymfony:2.8frommihai-stancu:embedded_identifier_support
Closed

Embedded identifier support#16826

mihai-stancu wants to merge1 commit intosymfony:2.8frommihai-stancu:embedded_identifier_support

Conversation

@mihai-stancu
Copy link
Contributor

QA
Bug fix?yes
New feature?no
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed ticketsnone
LicenseMIT
Doc PRn/a

If you define your entity identifier using an embeddable class the identifier name will contain period symbols in it such asid.value which will generate a syntax error in the DQL lexer because parameter names are not allowed to contain period symbols.

Example to reproduce described bug:

/** * @ORM\Embeddable */class Identifier {/**     * @ORM\Column(type="integer")     */protected$value;}/** * @ORM\Entity */class Entity {/**     * @ORM\Id @ORM\Embedded(class="Identifier")     */protected$id;}

@sstok
Copy link
Contributor

Can you add a test to prevent future regressions?

Status: Needs work

@mihai-stancu
Copy link
ContributorAuthor

Sure, will come back with the test for this soon.

I just want to make sure there's no counter opinion relating to this (such as "why would you use embedded objects as entity identifiers").

@mihai-stancu
Copy link
ContributorAuthor

@sstok sorry for the delay, I added the suggested tests.

@fabpot
Copy link
Member

Thank you@mihai-stancu.

fabpot added a commit that referenced this pull requestDec 26, 2015
This PR was submitted for the 2.8 branch but it was merged into the 2.3 branch instead (closes#16826).Discussion----------Embedded identifier support| Q             | A| ------------- | ---| Bug fix?      | yes| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets | none| License       | MIT| Doc PR        | n/aIf you define your entity identifier using an embeddable class the identifier name will contain period symbols in it such as `id.value` which will generate a syntax error in the DQL lexer because parameter names are not allowed to contain period symbols.Example to reproduce described bug:```php/** *@Orm\Embeddable */class Identifier {    /**     *@Orm\Column(type="integer")     */    protected $value;}/** *@Orm\Entity */class Entity {    /**     *@Orm\Id@Orm\Embedded(class="Identifier")     */    protected $id;}```Commits-------38fdda6 Embedded identifier support
@fabpotfabpot closed thisDec 26, 2015
This was referencedDec 26, 2015
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

5 participants

@mihai-stancu@sstok@fabpot@jakzal@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp