Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Doctrine][PropertyInfo] Detect if the ID is writeable #31486

Merged
merged 1 commit into from May 13, 2019

Conversation

dunglas
Copy link
Member

@dunglas dunglas commented May 12, 2019

Q A
Branch? 4.3
Bug fix? yes
New feature? yes
BC breaks? no
Deprecations? yes/no
Tests pass? yes
Fixed tickets n/a
License MIT
Doc PR n/a

Companion of #31481. Allows to detect that ids with a generated value aren't writable (because the DBMS will generate the ID by itself). It could be considered as a bug fix or as a new feature. I prefer to not merge in in 3.4. However, it becomes necessary for autovalidation to work with such entities, so it should be in 4.3:

/**
 * @Entity
 */
class Foo
{
    /**
     * @Id
     * @GeneratedValue(strategy="AUTO")
     * @Column(type="integer")
     */
    public $id;
}

@fabpot
Copy link
Member

fabpot commented May 13, 2019

Thank you @dunglas.

@fabpot fabpot merged commit 4598235 into symfony:4.3 May 13, 2019
fabpot added a commit that referenced this pull request May 13, 2019
… (dunglas)

This PR was merged into the 4.3 branch.

Discussion
----------

[Doctrine][PropertyInfo] Detect if the ID is writeable

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes
| New feature?  | yes <!-- please update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | yes/no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a

Companion of #31481. Allows to detect that ids with a generated value aren't writable (because the DBMS will generate the ID by itself). It could be considered as a bug fix or as a new feature. I prefer to not merge in in 3.4. However, it becomes necessary for autovalidation to work with such entities, so it should be in 4.3:

```php
/**
 * @entity
 */
class Foo
{
    /**
     * @id
     * @GeneratedValue(strategy="AUTO")
     * @column(type="integer")
     */
    public $id;
}
```

Commits
-------

4598235 [Doctrine][PropertyInfo] Detect if the ID is writeable
@fabpot fabpot mentioned this pull request May 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants