summaryrefslogtreecommitdiff
path: root/vendor/doctrine/orm/src/Mapping/Builder/EmbeddedBuilder.php
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/doctrine/orm/src/Mapping/Builder/EmbeddedBuilder.php')
-rw-r--r--vendor/doctrine/orm/src/Mapping/Builder/EmbeddedBuilder.php46
1 files changed, 46 insertions, 0 deletions
diff --git a/vendor/doctrine/orm/src/Mapping/Builder/EmbeddedBuilder.php b/vendor/doctrine/orm/src/Mapping/Builder/EmbeddedBuilder.php
new file mode 100644
index 0000000..b9d2127
--- /dev/null
+++ b/vendor/doctrine/orm/src/Mapping/Builder/EmbeddedBuilder.php
@@ -0,0 +1,46 @@
1<?php
2
3declare(strict_types=1);
4
5namespace Doctrine\ORM\Mapping\Builder;
6
7/**
8 * Embedded Builder
9 *
10 * @link www.doctrine-project.com
11 */
12class EmbeddedBuilder
13{
14 /** @param mixed[] $mapping */
15 public function __construct(
16 private readonly ClassMetadataBuilder $builder,
17 private array $mapping,
18 ) {
19 }
20
21 /**
22 * Sets the column prefix for all of the embedded columns.
23 *
24 * @return $this
25 */
26 public function setColumnPrefix(string $columnPrefix): static
27 {
28 $this->mapping['columnPrefix'] = $columnPrefix;
29
30 return $this;
31 }
32
33 /**
34 * Finalizes this embeddable and attach it to the ClassMetadata.
35 *
36 * Without this call an EmbeddedBuilder has no effect on the ClassMetadata.
37 */
38 public function build(): ClassMetadataBuilder
39 {
40 $cm = $this->builder->getClassMetadata();
41
42 $cm->mapEmbedded($this->mapping);
43
44 return $this->builder;
45 }
46}