fmsystem-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Fmsystem-commits] [6856] Added method and exception handling


From: Petur Thorsteinsson
Subject: [Fmsystem-commits] [6856] Added method and exception handling
Date: Thu, 27 Jan 2011 08:27:29 +0000

Revision: 6856
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=6856
Author:   peturbjorn
Date:     2011-01-27 08:27:26 +0000 (Thu, 27 Jan 2011)
Log Message:
-----------
Added method and exception handling

Modified Paths:
--------------
    branches/dev-bim2/property/inc/class.bobimmodel.inc.php

Modified: branches/dev-bim2/property/inc/class.bobimmodel.inc.php
===================================================================
--- branches/dev-bim2/property/inc/class.bobimmodel.inc.php     2011-01-27 
08:18:17 UTC (rev 6855)
+++ branches/dev-bim2/property/inc/class.bobimmodel.inc.php     2011-01-27 
08:27:26 UTC (rev 6856)
@@ -18,6 +18,7 @@
        public function removeIfcModelByModelId();
        public function setModelName($name);
        public function getModelName();
+       public function getIfcFileNameWithRealPath();
 }
 
 class bobimmodel_impl implements bobimmodel {
@@ -128,6 +129,13 @@
                return false;
                
        }
+       public function getIfcFileNameWithRealPath() {
+               $this->checkIdArguments();
+               /* @var $bimModel BimModel */
+               $bimModel = 
$this->sobimmodel->retrieveBimModelInformationById();
+               $this->sovfs->setFilename($bimModel->getFileName());
+               return $this->sovfs->getAbsolutePathOfVfsFile();
+       }
        /*
         * needs sobimmodel object with db and  modelId set
         * @return boolean
@@ -141,9 +149,10 @@
        private function displayArguments() {
                $string = "Argument list:\n".
                                "Model name:\t $this->modelName \n".
-                               "Model id:\t $this->modelId \n".
+                               "Model id:\t 
".$this->sobimmodel->getModelId()." \n".
                                "SOvfs:\t ".gettype($this->sovfs)."\n".
-                               "SObimmodel:\t 
".gettype($this->sobimmodel)."\n";
+                               "SObimmodel:\t 
".gettype($this->sobimmodel)."\n".
+                               "Submodule:\t 
".$this->sovfs->getSubModule()."\n";
                return $string;
                
        }
@@ -163,6 +172,7 @@
        /*
         * needs sobimmodel object with db and  modelId set
         * needs sovfs object, with submodule set
+        * @throws ModelDoesNotExistException
         */
        public function removeIfcModelByModelId() {
                try {
@@ -171,12 +181,17 @@
                        throw $e;
                }
                /* @var $bimModel BimModel */
-               $bimModel = 
$this->sobimmodel->retrieveBimModelInformationById();
-               $this->sobimmodel->setModelName($bimModel->getName());
-               $this->sobimmodel->setVfsdatabaseid($bimModel->getVfsFileId());
+               try {
+                       $bimModel = 
$this->sobimmodel->retrieveBimModelInformationById();
+                       $this->sobimmodel->setModelName($bimModel->getName());
+                       
$this->sobimmodel->setVfsdatabaseid($bimModel->getVfsFileId());
+                       
+                       $this->sovfs->setFilename($bimModel->getFileName());
+                       $this->removeIfcModel();
+               } catch (ModelDoesNotExistException $e) {
+                       throw new ModelDoesNotExistException();
+               }
                
-               $this->sovfs->setFilename($bimModel->getFileName());
-               $this->removeIfcModel();
        }
        
        private function checkIdArguments() {




reply via email to

[Prev in Thread] Current Thread [Next in Thread]