Changeset 28 for Dev/trunk/classes/SurveyDatabaseInterface.php
- Timestamp:
- 07/21/11 13:06:09 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Dev/trunk/classes/SurveyDatabaseInterface.php
r26 r28 10 10 11 11 class SurveyDatabaseInterface 12 { 13 protected static $instance; 14 12 { 15 13 protected $surveyRDFWriter; 16 14 protected $surveyRDFReader; 17 15 18 16 19 p rotected function __construct()17 public function __construct($surveyID=null) 20 18 { 21 //protected to prevent direct instantiation 22 $surveyUID = md5( uniqid(rand(), true) ); 23 19 if($surveyID == null) 20 $surveyUID = md5( uniqid(rand(), true) ); 21 else 22 $surveyUID = $surveyID; 23 24 24 $this->surveyRDFWriter = new SurveyRDFWriter($surveyUID); 25 25 $this->surveyRDFReader = new SurveyRDFReader($surveyUID); 26 26 } 27 28 public static function getInstance() 29 { 30 if (!self::$instance) 31 { 32 self::$instance = new SurveyDatabaseInterface(); 33 } 34 35 return self::$instance; 36 } 27 28 public function __destruct() 29 { 30 echo "Destroyed"; 31 } 37 32 38 33 public function setSurveyInfo($survey) … … 76 71 $resultSurvey = $this->surveyRDFReader->getSurveyInfo(); 77 72 73 $surveyInfo['surveyID'] = substr($resultSurvey[0][0]['?uid'],9,strlen($resultSurvey[0][0]['?uid'])-11); 78 74 $surveyInfo['surveyTitle'] = substr($resultSurvey[0][0]['?title'],9,strlen($resultSurvey[0][0]['?title'])-11); 79 75 $surveyInfo['surveyDescription'] = substr($resultSurvey[0][0]['?description'],9,strlen($resultSurvey[0][0]['?description'])-11);
Note: See TracChangeset
for help on using the changeset viewer.