本文整理汇总了PHP中Zend_Db_Table_Abstract::delete方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Db_Table_Abstract::delete方法的具体用法?PHP Zend_Db_Table_Abstract::delete怎么用?PHP Zend_Db_Table_Abstract::delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_Db_Table_Abstract
的用法示例。
在下文中一共展示了Zend_Db_Table_Abstract::delete方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: delete
/**
* delete row(s)
*
* @param array $data
* @return int
*/
public function delete($id)
{
//delete permission of the resource
$permissions = new Controlmodule_Model_DbTable_Permissions();
$permissions->delete("resource_id=" . (int) $id);
return parent::delete('id = ' . (int) $id);
}
示例2: delete
public function delete($id)
{
try {
parent::delete($id);
} catch (Exception $e) {
echo 'Ocorreu um erro ao excluir os dados.';
}
}
示例3: delete
public function delete($where)
{
$this->where = $where;
$last_id = parent::delete($this->where);
if ($last_id > 0) {
$this->_notifyObservers("delete");
}
return $last_id;
}
示例4: delete
public function delete($id)
{
try {
parent::delete($id);
} catch (Exception $exc) {
//echo $exc->getTraceAsString();
echo 'Ocorreu um erro ao excluir os dados';
}
}
示例5: delete
public function delete($where)
{
if (count($where) == 0) {
throw new Exception();
}
foreach ($where as $k => $v) {
$where[$k . ' = ?'] = $v;
unset($where[$k]);
}
return parent::delete($where);
}
示例6: bulkDelete
/**
* Bulk Delete entries
*
* @param array With serialized ids
* @return bool
*/
protected function bulkDelete(array $bulkIds)
{
if (empty($bulkIds)) {
return false;
}
foreach ($bulkIds as $id) {
$primaryKey = urldecode($id);
$where = $this->_getWhereStatement($primaryKey);
$this->obj->delete($where);
}
return true;
}
示例7: deleteNode
/**
* deleteNode
* @param integer $intNodeId
* @author Thomas Schedler <tsh@massiveart.com>
* @version 1.0
*/
public function deleteNode($intNodeId)
{
$this->intNodeId = $intNodeId;
$this->loadNodeData();
if ($this->objNodeData instanceof Zend_Db_Table_Rowset_Abstract && count($this->objNodeData) > 0) {
$arrNode = $this->objNodeData->current()->toArray();
if (!is_null($this->strDBFRoot)) {
$this->intRootId = $arrNode[$this->strDBFRoot];
}
$this->lockTable();
$strSqlAddonRootId = '';
if (!is_null($this->strDBFRoot) && $this->intRootId > 0) {
$strSqlAddonRootId = $this->strDBFRoot . ' = ' . $this->intRootId . ' AND ';
}
/**
* delete categories
*/
$this->objTable->delete($strSqlAddonRootId . $this->strDBFLft . ' BETWEEN ' . $arrNode[$this->strDBFLft] . ' AND ' . $arrNode[$this->strDBFRgt] . '');
$this->shiftLRValues($arrNode[$this->strDBFRgt] + 1, $arrNode[$this->strDBFLft] - $arrNode[$this->strDBFRgt] - 1);
$this->unlockTable();
}
}
示例8: delete
public function delete($where)
{
parent::delete($where);
// $this->_purgeCache();
}
示例9: delete
/**
* Deletes existing rows.
*
* @param array|string $where SQL WHERE clause(s).
* @return int The number of rows deleted.
*/
public function delete($where)
{
Centurion_Signal::factory('pre_delete')->send($this, array($where));
list($found, $return) = Centurion_Traits_Common::checkTraitOverload($this, 'delete', array($where));
if (!$found) {
$return = parent::delete($where);
}
Centurion_Signal::factory('post_delete')->send($this, array($where));
return $return;
}
示例10: delete
/**
* Delete from the database.
*
* @param MIDAS_GlobalDao $dao
* @return true
* @throws Zend_Exception
*/
public function delete($dao)
{
if (!$dao->saved) {
throw new Zend_Exception('The dao should be saved first ...');
}
if (!isset($this->_key) || !$this->_key) {
$query = array();
foreach ($this->_mainData as $name => $option) {
if ($option['type'] == MIDAS_DATA) {
$query[$name . ' = ?'] = $dao->{$name};
}
}
if (empty($query)) {
throw new Zend_Exception('Huge error, you almost deleted everything');
}
parent::delete($query);
$dao->saved = false;
return true;
}
$key = $dao->getKey();
if (!isset($key)) {
throw new Zend_Exception('Unable to find the key');
}
parent::delete(array($this->_key . ' = ?' => $dao->getKey()));
$key = $dao->_key;
$dao->set($key, null);
$dao->saved = false;
return true;
}
示例11: delete
/**
* Deletes existing rows.
*
* @param array|string $where SQL WHERE clause(s).
* @return int The number of rows deleted.
*/
public function delete($where)
{
$this->_setAdapter(Zoo::getService('db')->getDb('master'));
return parent::delete($where);
}
示例12: delete
/**
* Deletes existing rows.
* @param array|string $where SQL WHERE clause(s).
* @return int The number of rows deleted.
*/
public function delete($where)
{
$this->notifyObservers('beforeDelete', array($this, &$where));
$result = parent::delete($where);
$this->notifyObservers('afterDelete', array($this, $result, $where));
return $result;
}
示例13: deleteByActionId
/**
* Delete all rules that are for a specific action
*
* @param int $actionId
* @return int number of deleted rows
*/
public function deleteByActionId($actionId)
{
return parent::delete($this->getAdapter()->quoteInto('uaru_uaa_id = ?', $actionId, Zend_Db::INT_TYPE));
}
示例14: delete
public function delete($where)
{
if ($this->_cache) {
$this->_cache->clean(Zend_Cache::CLEANING_MODE_MATCHING_TAG);
}
return parent::delete($where);
}
示例15: delete
/**
* Delete the record by its id
*
* @param int $id
*/
public function delete($id)
{
try {
if ($this->useTransaction()) {
$this->getAdapter()->beginTransaction();
}
$tmp = $this->get($id);
//$objid = $tmp->objid;
$where = $this->getAdapter()->quoteInto($this->_primary . ' = ?', $id);
$r = parent::delete($where);
// $do = new Agana_Domain_Object();
// $o = $do->getById($objid);
// $do->setObject($o);
// $do->delete();
if ($this->useTransaction()) {
$this->getAdapter()->commit();
}
return;
} catch (Exception $pdoe) {
if ($this->useTransaction()) {
$this->getAdapter()->rollBack();
}
throw new Agana_Exception($pdoe->getMessage());
}
}