public function loadIfcItemsIntoDatabase()
 {
     $this->checkArguments();
     /* @var $modelInfo SimpleXMLElement */
     $modelInfo = $this->ifcXml->modelInformation[0];
     $modelInfoXml = $modelInfo->asXML();
     $bimmodelInformation = new BimModelInformation();
     $bimmodelInformation->loadVariablesFromXml($modelInfo);
     $this->sobimmodelinformation->setBimModelInformation($bimmodelInformation);
     try {
         $this->sobimmodelinformation->updateModelInformation();
     } catch (Exception $e) {
         throw $e;
     }
     //var_dump($this->ifcXml);
     $BimItems = $this->loopThrough();
     foreach ($BimItems as $item) {
         $type = $item->getType();
         try {
             $this->sobimtype->addBimObjectType($type);
         } catch (Exception $e) {
             // do nothing
         }
         try {
             $this->sobimitem->addBimItem($item);
         } catch (BimDataException $e) {
             throw new BimDataException("Data exception\n MSG:" . $e->getMessage() . "\nReason:" . $e->getPrevious()->getMessage(), $e);
             //echo "Data exception with message:".$e->getMessage()."\n";
             //echo "Reason:".$e->getPrevious()->getMessage();
             //break;
         }
     }
 }
 public function testLoadXmlModelInformation()
 {
     $bimModelInformation = new BimModelInformation();
     $bimModelInformation->loadVariablesFromXml($this->modelInformation);
     $this->assertEquals("reference file created for the Basic FM Handover View", $bimModelInformation->getAuthorization());
     $this->assertEquals("Thomas Liebich", $bimModelInformation->getAuthor());
     $this->assertEquals(1296118479, $bimModelInformation->getChangeDate());
     $this->assertEquals("ViewDefinition [CoordinationView, FMHandOverView]", $bimModelInformation->getDescription());
     $this->assertEquals("AEC3", $bimModelInformation->getOrganization());
     $this->assertEquals("IFC text editor", $bimModelInformation->getOriginatingSystem());
     $this->assertEquals("IFC text editor", $bimModelInformation->getPreProcessor());
     $this->assertEquals(null, $bimModelInformation->getValDate());
     $this->assertEquals("IFC2X3", $bimModelInformation->getNativeSchema());
 }