当前位置: 首页>>代码示例>>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;未经允许,请勿转载。