/**
  * 	getInstance
  *
  * 	Returns a single EasyContactFormsApplicationSettings instance
  *
  * @param  $showmessages
  * 
  *
  * @return object
  * 	the EasyContactFormsApplicationSettings instance
  */
 function getInstance($showmessages = TRUE)
 {
     static $obj;
     if (!isset($obj)) {
         $obj = new EasyContactFormsApplicationSettings();
         $obj->selectstmt = "SELECT * FROM " . $obj->getTableName() . " WHERE id = :id";
         $obj->fields = $obj->getObjectData(1);
         $needssave = FALSE;
         if ($obj->get('SecretWord') == '') {
             $obj->set('SecretWord', md5('mt=' . microtime()));
             $needssave = TRUE;
         }
         if ($obj->hasField('InitTime') && $obj->isEmpty('InitTime')) {
             $obj->set('InitTime', date(DATE_ATOM));
             $needssave = TRUE;
         }
         if ($obj->hasField('PhoneRegEx') && $obj->get('PhoneRegEx') == '') {
             $obj->set('PhoneRegEx', '(\\+{0,1}\\d{1,2})*\\s*(\\(?\\d{3}\\)?\\s*)*\\d{3}(-{0,1}|\\s{0,1})\\d{2}(-{0,1}|\\s{0,1})\\d{2}$');
             $needssave = TRUE;
         }
         if ($obj->hasField('FileFolder') && $obj->get('FileFolder') == '') {
             $obj->set('FileFolder', 'files');
             $needssave = TRUE;
         }
         if ($needssave) {
             $obj->save();
         }
     }
     if ($showmessages) {
         $obj->getLinkMessage();
     }
     return $obj;
 }
 /**
  * 	getInstance
  *
  * 	Returns a single EasyContactFormsApplicationSettings instance
  *
  * @param  $showmessages
  * 
  *
  * @return object
  * 	the EasyContactFormsApplicationSettings instance
  */
 function getInstance($showmessages = TRUE)
 {
     static $obj;
     if (!isset($obj)) {
         $obj = new EasyContactFormsApplicationSettings();
         $obj->selectstmt = "SELECT id, UseTinyMCE, ApplicationWidth, ApplicationWidth2, FixJSLoading, FormCompletionMinTime, FormCompletionMaxTime, FixStatus0, InitTime, ShowPoweredBy, FixStatus02, w3cCompliant, FixJSLoading2, AllowMarkupInEntries, SkipWeeklyReport, FileFolder, ProductVersion, PhoneRegEx FROM " . $obj->getTableName() . " WHERE id = :id";
         $obj->fields = $obj->getObjectData(1);
         $needssave = FALSE;
         if ($obj->get('SecretWord') == '') {
             $obj->set('SecretWord', md5('mt=' . microtime()));
             $needssave = TRUE;
         }
         if ($obj->hasField('InitTime') && $obj->isEmpty('InitTime')) {
             $obj->set('InitTime', date(DATE_ATOM));
             $needssave = TRUE;
         }
         if ($obj->hasField('PhoneRegEx') && $obj->isEmpty('PhoneRegEx')) {
             $obj->set('PhoneRegEx', '(\\+{0,1}\\d{1,2})*\\s*(\\(?\\d{3}\\)?\\s*)*\\d{3}(-{0,1}|\\s{0,1})\\d{2}(-{0,1}|\\s{0,1})\\d{2}$');
             $needssave = TRUE;
         }
         if ($obj->hasField('FileFolder') && $obj->get('FileFolder') == '') {
             $obj->set('FileFolder', 'files');
             $needssave = TRUE;
         }
         if ($needssave) {
             $obj->save();
         }
     }
     if ($showmessages) {
         $obj->getLinkMessage();
     }
     return $obj;
 }