/**
  * @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;
 }
 /**
  * Fügt dem Datenmodell dieses Views das übergebene Entity hinzu
  *
  * @param $entity
  */
 public function addEntity(EntityDefinition $entity)
 {
     if ($this->model === null) {
         $this->model = new Model();
     }
     $this->model->addEntity($entity);
 }
 /**
  * Diese Methode erzeugt aus einem XML-Element die Modulobjekte
  *
  * @param SimpleXMLElement $xml XML-Definition
  * @return Module Das erzeugte Modul
  *
  */
 public function createByXml(SimpleXMLElement $xml, $directory)
 {
     $module = new Module();
     $module->name = (string) $xml['name'];
     $module->version = (string) $xml->version;
     $module->description = (string) $xml->description;
     $module->author = (string) $xml->author;
     $module->image = (string) $xml->image;
     $module->namespace = (string) $xml->namespace;
     $module->path = $directory;
     $module->qualifiedName = (string) $xml->qualifiedName;
     if ($module->qualifiedName === '') {
         $module->qualifiedName = $module->name;
     }
     // Model
     $module->model = Model::createByXml($module, $xml->model);
     // Aktionen
     foreach ($xml->actions->action as $action) {
         $module->actions[(string) $action['name']] = Action::createByXml($action, $module);
     }
     $module->init();
     return $module;
 }