當前位置: 首頁>>代碼示例>>PHP>>正文


PHP PHPWS_DB::saveObject方法代碼示例

本文整理匯總了PHP中PHPWS_DB::saveObject方法的典型用法代碼示例。如果您正苦於以下問題:PHP PHPWS_DB::saveObject方法的具體用法?PHP PHPWS_DB::saveObject怎麽用?PHP PHPWS_DB::saveObject使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在PHPWS_DB的用法示例。


在下文中一共展示了PHPWS_DB::saveObject方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: save

 public function save()
 {
     $db = new PHPWS_DB('checkin_visitor');
     if (empty($this->arrival_time)) {
         $this->arrival_time = time();
     }
     return $db->saveObject($this);
 }
開發者ID:HaldunA,項目名稱:phpwebsite,代碼行數:8,代碼來源:Visitors.php

示例2: save

 public function save()
 {
     $db = new PHPWS_DB('analytics_tracker');
     $result = $db->saveObject($this);
     if (PHPWS_Error::logIfError($result)) {
         return $result;
     }
 }
開發者ID:HaldunA,項目名稱:phpwebsite,代碼行數:8,代碼來源:Tracker.php

示例3: save

 public function save()
 {
     $db = new \PHPWS_DB('prop_report');
     if (!$this->id) {
         $this->date_sent = time();
     }
     return $db->saveObject($this);
 }
開發者ID:HaldunA,項目名稱:phpwebsite,代碼行數:8,代碼來源:Report.php

示例4: save

 /**
  * Saves a new or updated floor hall object
  */
 public function save()
 {
     $db = new PHPWS_DB('hms_floor');
     $result = $db->saveObject($this);
     if (!$result || PHPWS_Error::logIfError($result)) {
         throw new DatabaseException($result->toString());
     }
 }
開發者ID:jlbooker,項目名稱:homestead,代碼行數:11,代碼來源:HMS_Floor.php

示例5: save

 public function save($insert = TRUE)
 {
     $db = new PHPWS_DB('search_stats');
     $this->keyword = trim($this->keyword);
     if (!$insert) {
         $db->addWhere('keyword', $this->keyword);
     }
     return $db->saveObject($this);
 }
開發者ID:HaldunA,項目名稱:phpwebsite,代碼行數:9,代碼來源:Stats.php

示例6: save

 public function save()
 {
     if (!$this->to_user_id || !$this->from_user_id) {
         return \PHPWS_Error('Cannot save message.');
     }
     $this->date_sent = time();
     $db = new \PHPWS_DB('prop_messages');
     return $db->saveObject($this);
 }
開發者ID:HaldunA,項目名稱:phpwebsite,代碼行數:9,代碼來源:Message.php

示例7: save

 /**
  * Saves the current Assignment object to the database.
  */
 public function save()
 {
     $db = new PHPWS_DB('hms_learning_community_assignment');
     $result = $db->saveObject($this);
     if (PHPWS_Error::logIfError($result)) {
         throw new DatabaseException($result->toString());
     }
     return TRUE;
 }
開發者ID:jlbooker,項目名稱:homestead,代碼行數:12,代碼來源:HMS_RLC_Assignment.php

示例8: save

 public function save()
 {
     $db = new PHPWS_DB('hms_special_assignment');
     $result = $db->saveObject($this);
     if (PHPWS_Error::logIfError($result)) {
         throw new DatabaseException($result->getMessage());
     }
     return true;
 }
開發者ID:jlbooker,項目名稱:homestead,代碼行數:9,代碼來源:SpecialAssignment.php

示例9: save

 public function save()
 {
     $db = new PHPWS_DB('hms_eligibility_waiver');
     $result = $db->saveObject($this);
     if (!$result || PHPWS_Error::logIfError($result)) {
         return false;
     }
     return true;
 }
開發者ID:jlbooker,項目名稱:homestead,代碼行數:9,代碼來源:HMS_Eligibility_Waiver.php

示例10: save

 public function save()
 {
     $this->stamp();
     $db = new PHPWS_DB('hms_residence_hall');
     $result = $db->saveObject($this);
     if (!$result || PHPWS_Error::logIfError($result)) {
         throw new DatabaseException($result->toString());
     }
     return true;
 }
開發者ID:jlbooker,項目名稱:homestead,代碼行數:10,代碼來源:HMS_Residence_Hall.php

示例11: save

 /**
  * Saves this queue item
  */
 public function save()
 {
     $db = new PHPWS_DB('hms_banner_queue');
     $this->stamp();
     $result = $db->saveObject($this);
     if (PHPWS_Error::logIfError($result)) {
         throw new DatabaseException($result->toString());
     }
     return TRUE;
 }
開發者ID:jlbooker,項目名稱:homestead,代碼行數:13,代碼來源:BannerQueueItem.php

示例12: save

 public function save($key_id)
 {
     $db = new PHPWS_DB('ps_text');
     $result = $db->saveObject($this);
     if (PHPWS_Error::isError($result)) {
         return $result;
     }
     $search = new Search($key_id);
     $search->addKeywords($this->content);
     return $search->save();
 }
開發者ID:HaldunA,項目名稱:phpwebsite,代碼行數:11,代碼來源:PS_Text.php

示例13: save

 /**
  * Saves this term object.
  */
 public function save()
 {
     $db = new PHPWS_DB('hms_term');
     // "where" breaks the save if creating new term
     if (!$this->isNew) {
         $db->addWhere('term', $this->term);
     }
     $result = $db->saveObject($this);
     if (PHPWS_Error::logIfError($result)) {
         throw new DatabaseException($result->toString());
     }
 }
開發者ID:jlbooker,項目名稱:homestead,代碼行數:15,代碼來源:Term.php

示例14: save

 public function save($term)
 {
     $this->term = $term;
     $this->timestamp = time();
     $db = new PHPWS_DB('hms_student_cache');
     try {
         $result = $db->saveObject($this);
     } catch (\Exception $e) {
         // Silently log any errors
         PHPWS_Error::logIfError($e);
     }
 }
開發者ID:jlbooker,項目名稱:homestead,代碼行數:12,代碼來源:CachedStudent.php

示例15: save

 /**
  * Saves the given object to the database.
  * @param Object $obj
  */
 public static function save(DbStorable $obj)
 {
     $db = new \PHPWS_DB($obj->getTableName());
     try {
         $result = $db->saveObject($obj);
     } catch (\Exception $e) {
         // rethrow any exceptions
         throw $e;
     }
     if (\PHPWS_Error::logIfError($result)) {
         throw new \Exception($result->toString());
     }
     return $obj->id;
 }
開發者ID:jlbooker,項目名稱:InternshipInventory,代碼行數:18,代碼來源:DatabaseStorage.php


注:本文中的PHPWS_DB::saveObject方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。