예제 #1
0
 /**
  * Finalizes this field and attach it to the ClassMetadata.
  *
  * Without this call a FieldBuilder has no effect on the ClassMetadata.
  *
  * @return ClassMetadataBuilder
  */
 public function build()
 {
     $cm = $this->builder->getClassMetadata();
     if ($this->generatedValue) {
         $cm->setIdGeneratorType(constant('Doctrine\\ORM\\Mapping\\ClassMetadata::GENERATOR_TYPE_' . $this->generatedValue));
     }
     if ($this->version) {
         $cm->setVersionMapping($this->mapping);
     }
     $cm->mapField($this->mapping);
     if ($this->sequenceDef) {
         $cm->setSequenceGeneratorDefinition($this->sequenceDef);
     }
     return $this->builder;
 }
예제 #2
0
 /**
  * Finalizes this embeddable and attach it to the ClassMetadata.
  *
  * Without this call an EmbeddedBuilder has no effect on the ClassMetadata.
  *
  * @return ClassMetadataBuilder
  */
 public function build()
 {
     $cm = $this->builder->getClassMetadata();
     $cm->mapEmbedded($this->mapping);
     return $this->builder;
 }