/**
  * Erzeugt die Entity auf Basis eines XML Elements aus der Mapping-Konfiguration
  * @param Module $module
  * @param SimpleXMLElement $entity
  * @return EntityDefinition
  * @throws Exception
  */
 public static function createByXml(Module $module, SimpleXMLElement $entity)
 {
     $temp = new EntityDefinition();
     $temp->module = $module;
     $temp->buildEntity($entity);
     return $temp;
 }
 /**
  * Liest eine Tabelle aus den XML Daten ein und legt diese
  * entsprechend in der Datenbank an
  */
 public function forwardEngineer()
 {
     $this->current = Modules::getModule($this->request->current);
     $this->entity = $this->current->getEntity($this->request->id);
     $this->entity->forwardEngineer();
     $this->request->clear();
     $this->request->id = $this->current->qualifiedName;
     $this->request->initPanel = 2;
 }
Пример #3
0
 /**
  * @param Module $module
  * @param SimpleXmlElement $xml
  * @param SimpleXmlElement $xml
  * @return Model
  */
 public static function createByXml($module, $xml)
 {
     $temp = new Model();
     $temp->setModule($module);
     foreach ($xml->entity as $entity) {
         if ((string) $entity['match'] !== '') {
             $temp->entities[(string) $entity['match']] = EntityDefinition::createByXml($module, $entity);
         } else {
             $temp->entities[(string) $entity['name']] = EntityDefinition::createByXml($module, $entity);
         }
     }
     return $temp;
 }