当前位置: 首页>>代码示例>>PHP>>正文


PHP Zend_Db_Table::delete方法代码示例

本文整理汇总了PHP中Zend_Db_Table::delete方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Db_Table::delete方法的具体用法?PHP Zend_Db_Table::delete怎么用?PHP Zend_Db_Table::delete使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Zend_Db_Table的用法示例。


在下文中一共展示了Zend_Db_Table::delete方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: delete

 public function delete($id)
 {
     $db = $this->getAdapter();
     $where = $db->quoteInto("id in(?)", $id);
     $deletedRows = parent::delete($where);
     return $deletedRows ? true : false;
 }
开发者ID:BGCX262,项目名称:zshop-zendframework-svn-to-git,代码行数:7,代码来源:MessageModel.php

示例2: delete

 public function delete($where)
 {
     $rows_affected = parent::delete($where);
     if ($rows_affected == 0) {
         throw new Respondenci_Exception('Podany adres e-mail nie istnieje 						 w bazie danych.');
     }
 }
开发者ID:BackupTheBerlios,项目名称:phppool,代码行数:7,代码来源:Respondenci.php

示例3: delete

 public function delete($id, $log = true)
 {
     $where = $this->getAdapter()->quoteInto('id = ?', $id);
     parent::delete($where);
     if ($log) {
         log_sql($this->_name, $id, 'deleted');
         set_session('notice', 'last record deleted');
     }
 }
开发者ID:shadobladez,项目名称:erp2,代码行数:9,代码来源:Application.php

示例4: del

 /**
  * Del new setting and return ID of the setting
  */
 public function del($setting, $table)
 {
     global $logger;
     $oTable = new Zend_Db_Table($table);
     $where = $oTable->getAdapter()->quoteInto('id = ?', $setting->id);
     $result = $oTable->delete($where);
     $logger->log("Del setting {$table}={$setting->id}", Zend_Log::INFO);
     return $result;
 }
开发者ID:ka2er,项目名称:mmc-flex,代码行数:12,代码来源:SettingsMapper.php

示例5: delete

 /**
  * delete с учётом удаления таблицы с публикациями
  *
  * @param  array|string $where SQL WHERE clause(s).
  * @return int          The number of rows deleted.
  */
 public function delete($where)
 {
     $resultSet = $this->fetchAll($where);
     if (sizeof($resultSet)) {
         foreach ($resultSet as $row) {
             $_migrationManager = new Modules_Dbmigrations_Framework_Manager();
             $_migrationManager->downTo('Modules_Publications_Migrations_CreatePublicationAbstractTable', $row->table_name);
         }
     }
     return parent::delete($where);
 }
开发者ID:kytvi2p,项目名称:ZettaFramework,代码行数:17,代码来源:List.php

示例6: addSite

 /**
  * Stores information about trusted/untrusted site for given user
  *
  * @param string $id user identity URL
  * @param string $site site URL
  * @param mixed $trusted trust data from extensions or just a boolean value
  * @return bool
  */
 public function addSite($id, $site, $trusted)
 {
     if (is_null($trusted)) {
         $this->_sitesTable->select()->where('site = ?', $site);
         $this->_sitesTable->delete($where);
         return true;
     }
     $row = $this->_sitesTable->createRow();
     $row->openid = $id;
     $row->site = $site;
     $row->time = date('Y-m-d H:i:s O');
     $row->trusted = serialize($trusted);
     $row->save();
     return true;
 }
开发者ID:heiglandreas,项目名称:Zend-Framework-OpenID-Provider,代码行数:23,代码来源:Db.php

示例7: delete

 /**
  * delete с учётом удаления поля из таблицы публикаций
  *
  * @param  array|string $where SQL WHERE clause(s).
  * @return int          The number of rows deleted.
  */
 public function delete($where)
 {
     $resultSet = $this->fetchAll($where);
     if (sizeof($resultSet)) {
         $modelList = new Modules_Publications_Model_List();
         foreach ($resultSet as $row) {
             $tableInfo = $modelList->fetchRow($modelList->select()->where('rubric_id = ?', $row->rubric_id));
             $tableName = $tableInfo->table_name;
             $filedName = $row->name;
             $_migrationManager = new Modules_Dbmigrations_Framework_Manager();
             $_migrationManager->downTo('Modules_Publications_Migrations_CreatePublicationAbstractFieled', array($tableName, $filedName));
         }
     }
     return parent::delete($where);
 }
开发者ID:kytvi2p,项目名称:ZettaFramework,代码行数:21,代码来源:Fields.php

示例8: productDeleteBefore

 /**
  * Handle product delete
  *
  * @param $event
  * @return AW_Advancedreports_Model_Observer
  */
 public function productDeleteBefore($event)
 {
     /** @var Mage_Catalog_Model_Product $product  */
     $product = $event->getProduct();
     $searchSku = $product->getSku();
     $sku = $product->getSku;
     /** @var AW_Advancedreports_Model_Sku $skuRelevance  */
     $sku = Mage::getModel('advancedreports/sku');
     $tableName = $sku->getResource()->getMainTable();
     $writeAdapter = $this->_helper()->getWriteAdapter();
     try {
         $writeAdapter->beginTransaction();
         $tableConnection = new Zend_Db_Table(array(Zend_Db_Table::ADAPTER => $writeAdapter, Zend_Db_Table::NAME => $tableName));
         $tableConnection->delete("sku = '{$searchSku}'");
         $writeAdapter->commit();
     } catch (Exception $e) {
         Mage::logException($e);
     }
     return $this;
 }
开发者ID:cnglobal-sl,项目名称:caterez,代码行数:26,代码来源:Observer.php

示例9: deleteThread

 /**
  * Deletes a new thread, by marking it as deleted. If both users deleted it
  * it is phisically deleted as well
  *
  * @param array $data: thread_id and user_id who is deleting
  */
 public function deleteThread(array $data)
 {
     /* Fetch thread */
     $threads_table = new Zend_Db_Table('threads');
     $select = $threads_table->select()->where('id = ?', $data['thread_id']);
     $thread = $threads_table->fetchRow($select);
     /* Update flags */
     if ($thread->user_from == $data['user_id']) {
         $thread->deleted_from = 1;
     } elseif ($thread->user_to == $data['user_id']) {
         $thread->deleted_to = 1;
     } else {
         return null;
     }
     $thread->save();
     /* If both deleted, delete physically */
     if ($thread->deleted_from && $thread->deleted_to) {
         $messages_table = new Zend_Db_Table('messages');
         $whereM = $messages_table->getAdapter()->quoteInto('id = ?', $data['thread_id']);
         $messages_table->delete($whereM);
         $thread->delete();
     }
     return;
 }
开发者ID:Arteaga2k,项目名称:nolotiro,代码行数:30,代码来源:Message.php

示例10: saveUserAttributes

 public function saveUserAttributes(Application_Model_Models_User $user)
 {
     $paramsCount = func_num_args();
     if ($paramsCount === 1) {
         list($user) = func_get_args();
         $attribs = $user->getAttributes();
     } elseif ($paramsCount === 2) {
         list($user, $attribs) = func_get_args();
     } elseif ($paramsCount === 3) {
         $params = func_get_args();
         $user = array_shift($params);
         $attribs = array($params[0] => $params[1]);
         unset($params);
     }
     $dbTable = new Zend_Db_Table('user_attributes');
     $userId = $user->getId();
     $dbTable->delete(array('user_id = ?' => $userId));
     if (is_array($attribs) && !empty($attribs)) {
         foreach ($attribs as $name => $value) {
             $dbTable->insert(array('user_id' => $userId, 'attribute' => $name, 'value' => $value));
         }
         $user->setAttributes($attribs);
     }
     return $user;
 }
开发者ID:PavloKovalov,项目名称:seotoaster,代码行数:25,代码来源:UserMapper.php

示例11: delete

 /**
  * 删除新闻
  *
  * @param array $arrayID
  */
 public function delete($arrayID)
 {
     try {
         //开启事务
         $this->getAdapter()->beginTransaction();
         //遍历所有ID
         foreach ($arrayID as $id) {
             //清除指定标识的缓存
             $this->_cache->clean(Zend_Cache::CLEANING_MODE_MATCHING_TAG, array(strtolower($this->_name)));
             $this->_cache->clean(Zend_Cache::CLEANING_MODE_MATCHING_TAG, array(strtolower($this->_name . '_findById_' . $id)));
         }
         //指定查询条件
         $where = $this->getAdapter()->quoteInto('id in(?)', $arrayID);
         parent::delete($where);
         //提交查询
         $this->getAdapter()->commit();
     } catch (Zend_Exception $e) {
         echo $e->getMessage();
         //如果出错则事务回滚
         $this->getAdapter()->rollBack();
     }
 }
开发者ID:Arrray,项目名称:PHPpractice,代码行数:27,代码来源:News.php

示例12: delete

 /**
  * delete data overloaded to log the action
  */
 public function delete($where)
 {
     $toreturn = parent::delete($where);
     if ($toreturn > 0) {
         $this->log('DELETE:' . $toreturn . ' row(s) deleted');
     } else {
         $this->log('DELETE:no row(s) deleted', Zend_Log::ERR);
     }
     return $toreturn;
 }
开发者ID:Cryde,项目名称:sydney-core,代码行数:13,代码来源:Table.php

示例13: delete

 /**
  * 删除ID所在行
  * @param int or array $id
  * @param string $column 字段名
  * @see Zend_Db_Table_Abstract::delete()
  * @return boolean 更新成功返回true,否则false
  */
 public function delete($id, $column = 'id')
 {
     $db = $this->getAdapter();
     $wherePre = $column . " in(?)";
     $where = $db->quoteInto($wherePre, $id);
     $deletedRows = parent::delete($where);
     return $deletedRows ? true : false;
 }
开发者ID:BGCX262,项目名称:zshop-zendframework-svn-to-git,代码行数:15,代码来源:BaseModel.php

示例14: unregisterRecipients

 /**
  * Unregisters plugin custom recipients
  * @param $pluginName
  * @return Application_Model_Mappers_EmailTriggersMapper
  */
 public function unregisterRecipients($pluginName)
 {
     $recipients = $this->_getRecipients($pluginName);
     if (is_array($recipients) && !empty($recipients)) {
         $recipientsTable = new Zend_Db_Table('email_triggers_recipient');
         foreach ($recipients as $recipient) {
             $recipientsTable->delete(array('recipient = ?' => $recipient));
         }
     }
     return $this;
 }
开发者ID:PavloKovalov,项目名称:seotoaster,代码行数:16,代码来源:EmailTriggersMapper.php

示例15: delete

 public function delete($where)
 {
     $this->_db = CrFramework_Db_Control::getAdapter('write');
     $this->setDefaultAdapter($this->_db);
     logStd(get_class($this) . '->delete()', 'Write to MASTER');
     return parent::delete($where);
 }
开发者ID:xinghao,项目名称:shs,代码行数:7,代码来源:Table.php


注:本文中的Zend_Db_Table::delete方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。