當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。