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

Support composite & non-identifier generated values #6684

Closed

Conversation

Majkl578
Copy link
Contributor

@Majkl578 Majkl578 commented Sep 3, 2017

  • enable generated values for composite identifiers
  • enable generated values for non-identifier fields
  • forbid IDENTITY in composite identifiers and on non-identifiers (not supported by platforms)

This is now possible thanks to f482d64.

Possible enhancements:

  • More platform-specific tests (i.e. sequences)?
  • Unsure about post-insert generators, should they be allowed? Or maybe removed in 3.0 as it really makes sense only for IDENTITY generator?

Closes #6422.
Closes #4704.
Closes #5416.
Closes #2400.

guilhermeblanco and others added 30 commits July 28, 2017 19:26
…ing saga). Renamed identity generator to become sequencing generators.
This tool reads and writes YAML files so it should be removed.
… a single, unified structure generatorDefinition
Ocramius and others added 5 commits August 28, 2017 19:58
…lass

Drop `Doctrine\ORM\Version`, using `PackageVersions\Version::getVersion("doctrine/orm")` instead, which is more reliable
…properties-generator

Use Generators instead of AppendIterator for properties iteration
@Majkl578 Majkl578 added this to the 3.0 milestone Sep 3, 2017
@@ -486,7 +486,7 @@ private function gatherColumn($classMetadata, FieldMetadata $fieldMetadata, Tabl
$options['customSchemaOptions'] = $fieldOptions;
}

if ($fieldMetadata->hasValueGenerator() && $fieldMetadata->getValueGenerator()->getType() === GeneratorType::IDENTITY && $classMetadata->getIdentifierFieldNames() == [$fieldName]) {
if ($fieldMetadata->hasValueGenerator() && $fieldMetadata->getValueGenerator()->getType() === GeneratorType::IDENTITY && in_array($fieldName, $classMetadata->getIdentifierFieldNames(), true)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line could use one or more linebreaks :P

@Majkl578 Majkl578 force-pushed the dev/composite-generated-values branch from 00bc67a to f5d58be Compare September 3, 2017 22:36
@Majkl578 Majkl578 force-pushed the dev/composite-generated-values branch from f5d58be to 1dbd8dc Compare September 3, 2017 22:38
@Majkl578 Majkl578 changed the title [WIP] Support composite & non-identifier generated values Support composite & non-identifier generated values Sep 3, 2017
@Majkl578 Majkl578 removed the WIP label Sep 3, 2017
@Majkl578 Majkl578 force-pushed the dev/composite-generated-values branch from c6a6212 to 9c82046 Compare September 3, 2017 23:00
@Majkl578 Majkl578 changed the base branch from develop to master January 2, 2018 20:31
@Majkl578 Majkl578 closed this Apr 16, 2019
@Majkl578 Majkl578 deleted the dev/composite-generated-values branch April 16, 2019 19:51
@greg0ire greg0ire removed this from the 3.0.0 milestone Jun 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
8 participants