Exemplo n.º 1
0
 private function addEmbedMapping(ClassMetadata $class, \SimpleXMLElement $embed, $type)
 {
     $attributes = $embed->attributes();
     $mapping = [];
     $this->_copyCommonPropertyAttributesToMapping($attributes, $mapping);
     switch ($type) {
         case 'one':
             $class->mapEmbedded($mapping);
             break;
         case 'list':
             $class->mapEmbeddedList($mapping);
             break;
         case 'set':
             $class->mapEmbeddedSet($mapping);
             break;
         case 'map':
             $class->mapEmbeddedMap($mapping);
             break;
         default:
             throw MappingException::invalidCollectionType($class->name, $type);
     }
 }