Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Remove internal tag from computeChangeSet#8600

Merged
greg0ire merged 1 commit into
doctrine:2.8.xfrom
VincentLanglet:computeChangeset
May 5, 2021
Merged

Remove internal tag from computeChangeSet#8600
greg0ire merged 1 commit into
doctrine:2.8.xfrom
VincentLanglet:computeChangeset

Conversation

@VincentLanglet
Copy link
Copy Markdown
Contributor

In the doctrine https://www.doctrine-project.org/projects/doctrine-orm/en/2.8/reference/events.html#onflush

The computeChangeSet is recommended to be used

If you create and persist a new entity in onFlush, then calling EntityManager#persist() is not enough. You have to execute an additional call to $unitOfWork->computeChangeSet($classMetadata, $entity).
Changing primitive fields or associations requires you to explicitly trigger a re-computation of the changeset of the affected entity. This can be done by calling $unitOfWork->recomputeSingleEntityChangeSet($classMetadata, $entity).

So the method shouldn't be flag as internal:

  • To provide a BC-promise
  • To avoid psalm error with internal method

@VincentLanglet
Copy link
Copy Markdown
Contributor Author

Friendly ping @greg0ire, what do you think about this PR ? :)

@greg0ire
Copy link
Copy Markdown
Member

greg0ire commented May 5, 2021

It makes sense to me 👍
Can you find the author of this comment and ping them if they are still part of the team?

@greg0ire greg0ire requested review from beberlei and ostrolucky May 5, 2021 12:50
@VincentLanglet
Copy link
Copy Markdown
Contributor Author

It was @beberlei 6f36672

@greg0ire
Copy link
Copy Markdown
Member

greg0ire commented May 5, 2021

Ok, I think the doc you linked to was already present, so this must be a mistake.

@greg0ire greg0ire merged commit 4ccc4e1 into doctrine:2.8.x May 5, 2021
@greg0ire greg0ire added this to the 2.8.5 milestone May 5, 2021
@greg0ire
Copy link
Copy Markdown
Member

greg0ire commented May 5, 2021

Thanks @VincentLanglet !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants