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


PHP DB_DataObject::delete方法代碼示例

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


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

示例1: delete

 function delete()
 {
     $result = parent::delete();
     if ($result != FALSE) {
         $this->removeFromSolr();
     }
     return $result;
 }
開發者ID:bryandease,項目名稱:VuFind-Plus,代碼行數:8,代碼來源:SolrDataObject.php

示例2: delete

 public function delete($useWhere = false)
 {
     // avoid those annoying PEAR::DB strict standards warnings it causes
     $old = error_reporting();
     error_reporting(error_reporting() & ~E_STRICT);
     $res = parent::delete($useWhere);
     // reset
     error_reporting($old);
     return $res;
 }
開發者ID:bashrc,項目名稱:gnusocial-debian,代碼行數:10,代碼來源:GS_DataObject.php

示例3: delete

 function delete()
 {
     $personId = $this->personId;
     $ret = parent::delete();
     //Load the person this is for, and update solr
     if ($personId) {
         require_once ROOT_DIR . '/sys/Genealogy/Person.php';
         $person = Person::staticGet('personId', $personId);
         $person->saveToSolr();
     }
     return $ret;
 }
開發者ID:bryandease,項目名稱:VuFind-Plus,代碼行數:12,代碼來源:Marriage.php

示例4: delete

 public function delete()
 {
     //Delete any items that are associated with the record
     if (strcasecmp($this->source, 'OverDrive') != 0) {
         $items = $this->getItems();
         foreach ($items as $item) {
             $item->delete();
         }
     }
     parent::delete();
 }
開發者ID:victorfcm,項目名稱:VuFind-Plus,代碼行數:11,代碼來源:EContentRecord.php

示例5: delete

 /**
  * Deletes items from table which match current objects variables.
  *
  * Returns the true on success
  *
  * for example
  *
  * Designed to be extended
  *
  * $object = new mytable();
  * $object->ID=123;
  * echo $object->delete(); // builds a conditon
  *
  * $object = new mytable();
  * $object->whereAdd('age > 12');
  * $object->limit(1);
  * $object->orderBy('age DESC');
  * $object->delete(true); // dont use object vars, use the conditions, limit and order.
  *
  * @param bool $useWhere (optional) If DB_DATAOBJECT_WHEREADD_ONLY is passed in then
  *             we will build the condition only using the whereAdd's.  Default is to
  *             build the condition only using the object parameters.
  *
  *     * @return mixed Int (No. of rows affected) on success, false on failure, 0 on no data affected
  */
 public function delete($useWhere = FALSE)
 {
     $result = parent::delete($useWhere);
     $event = new \Civi\Core\DAO\Event\PostDelete($this, $result);
     \Civi::service('dispatcher')->dispatch("DAO::post-delete", $event);
     return $result;
 }
開發者ID:konadave,項目名稱:civicrm-core,代碼行數:32,代碼來源:DAO.php

示例6: delete

 /**
  * Overwrite DB_DataObject::delete() method and add a "ON DELETE CASCADE"
  *
  * @param boolean $useWhere
  * @param boolean $cascadeDelete  If true it deletes also referenced tables
  *                                if this behavior is set in DataObject.
  *                                With this parameter it's possible to turn off default behavior
  *                                @see DB_DataObjectCommon:onDeleteCascade
  * @param boolean $parentid The audit ID of the parent object causing the cascade.
  * @return mixed True on success, false on failure, 0 on no data affected
  * @access protected
  */
 function delete($useWhere = false, $cascadeDelete = true, $parentid = null)
 {
     $this->_addPrefixToTableName();
     // clone this object and retrieve current values for auditing
     $doAffected = clone $this;
     if (!$useWhere) {
         // Clear any additional WHEREs if it's not used in delete statement
         $doAffected->whereAdd();
     }
     $doAffected->find();
     if ($this->onDeleteCascade && $cascadeDelete) {
         $aKeys = $this->keys();
         // Simulate "ON DELETE CASCADE"
         if (count($aKeys) == 1) {
             // Resolve references automatically only for records with one column as Primary Key
             // If table has more than one column in PK it is still possible to remove
             // manually connected tables (by overriding delete() method)
             $primaryKey = $aKeys[0];
             $linkedRefs = $this->_collectRefs($primaryKey);
             foreach ($this->onDeleteCascadeSkip as $table) {
                 unset($linkedRefs[$table]);
             }
             // Find all affected tuples
             while ($doAffected->fetch()) {
                 $id = $doAffected->audit(3, null, $parentid);
                 // Simulate "ON DELETE CASCADE"
                 $doAffected->deleteCascade($linkedRefs, $primaryKey, $id);
             }
         }
     }
     $result = parent::delete($useWhere);
     if ($result) {
         if (is_null($id)) {
             $doAffected->fetch();
             $doAffected->audit(3, null, $parentid);
         }
         return true;
     }
     return $result;
 }
開發者ID:Spark-Eleven,項目名稱:revive-adserver,代碼行數:52,代碼來源:DB_DataObjectCommon.php

示例7: delete

 function delete()
 {
     $this->decache();
     # while we still have the values!
     return parent::delete();
 }
開發者ID:Br3nda,項目名稱:laconica,代碼行數:6,代碼來源:Memcached_DataObject.php

示例8: delete

 public function delete()
 {
     $result = $this->trigger('delete');
     switch (true) {
         case $result === 'bypass':
             $this->clearFromRegistry($this->tableName(), $this->pk());
             return true;
             break;
         case $result === 'fail':
             return false;
             break;
         default:
             if (parent::delete() !== false) {
                 $this->clearFromRegistry($this->tableName(), $this->pk());
                 $this->trigger('postdelete');
                 return true;
             }
             return false;
     }
 }
開發者ID:demental,項目名稱:m,代碼行數:20,代碼來源:Pluggable.php

示例9: delete

 function delete()
 {
     $ret = parent::delete();
     return $ret;
 }
開發者ID:victorfcm,項目名稱:VuFind-Plus,代碼行數:5,代碼來源:EditorialReview.php


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