diff options
Diffstat (limited to 'vendor/doctrine/orm/src/Mapping/Builder/OneToManyAssociationBuilder.php')
| -rw-r--r-- | vendor/doctrine/orm/src/Mapping/Builder/OneToManyAssociationBuilder.php | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/vendor/doctrine/orm/src/Mapping/Builder/OneToManyAssociationBuilder.php b/vendor/doctrine/orm/src/Mapping/Builder/OneToManyAssociationBuilder.php new file mode 100644 index 0000000..077c558 --- /dev/null +++ b/vendor/doctrine/orm/src/Mapping/Builder/OneToManyAssociationBuilder.php | |||
| @@ -0,0 +1,46 @@ | |||
| 1 | <?php | ||
| 2 | |||
| 3 | declare(strict_types=1); | ||
| 4 | |||
| 5 | namespace Doctrine\ORM\Mapping\Builder; | ||
| 6 | |||
| 7 | /** | ||
| 8 | * OneToMany Association Builder | ||
| 9 | * | ||
| 10 | * @link www.doctrine-project.com | ||
| 11 | */ | ||
| 12 | class OneToManyAssociationBuilder extends AssociationBuilder | ||
| 13 | { | ||
| 14 | /** | ||
| 15 | * @psalm-param array<string, string> $fieldNames | ||
| 16 | * | ||
| 17 | * @return $this | ||
| 18 | */ | ||
| 19 | public function setOrderBy(array $fieldNames): static | ||
| 20 | { | ||
| 21 | $this->mapping['orderBy'] = $fieldNames; | ||
| 22 | |||
| 23 | return $this; | ||
| 24 | } | ||
| 25 | |||
| 26 | /** @return $this */ | ||
| 27 | public function setIndexBy(string $fieldName): static | ||
| 28 | { | ||
| 29 | $this->mapping['indexBy'] = $fieldName; | ||
| 30 | |||
| 31 | return $this; | ||
| 32 | } | ||
| 33 | |||
| 34 | public function build(): ClassMetadataBuilder | ||
| 35 | { | ||
| 36 | $mapping = $this->mapping; | ||
| 37 | if ($this->joinColumns) { | ||
| 38 | $mapping['joinColumns'] = $this->joinColumns; | ||
| 39 | } | ||
| 40 | |||
| 41 | $cm = $this->builder->getClassMetadata(); | ||
| 42 | $cm->mapOneToMany($mapping); | ||
| 43 | |||
| 44 | return $this->builder; | ||
| 45 | } | ||
| 46 | } | ||
