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


PHP DatabaseConnection::DELETEquery方法代码示例

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


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

示例1: deleteExistingRelations

 /**
  * Removes existing relations from the mm table from the database
  */
 protected function deleteExistingRelations()
 {
     $deleteQuery = $this->typo3Db->DELETEquery($this->table, $this->uidLocalField . '=' . $this->localUid);
     $this->utilityFuncs->debugMessage('sql_request', array($deleteQuery));
     $deleteResult = $this->typo3Db->sql_query($deleteQuery);
     if (!$deleteResult) {
         $this->utilityFuncs->throwException('Error in SQL query for deleting existing relations: ' . $this->typo3Db->sql_error());
     }
 }
开发者ID:astehlik,项目名称:typo3-extension-formhandler_subscription,代码行数:12,代码来源:UpdateMmData.php

示例2: dbDelete

 /**
  * Db delete object
  *
  * @param int $uid Uid
  * @param Tx_Commerce_Dao_BasicDaoObject $object Object
  *
  * @return void
  */
 protected function dbDelete($uid, Tx_Commerce_Dao_BasicDaoObject &$object)
 {
     $dbWhere = 'uid = ' . (int) $uid;
     // execute query
     $this->database->exec_DELETEquery($this->dbTable, $dbWhere);
     // any errors
     $error = $this->database->sql_error();
     if (!empty($error)) {
         $this->addError(array($error, $this->database->DELETEquery($this->dbTable, $dbWhere)));
     }
     // remove object itself
     $object->destroy();
 }
开发者ID:AndreasA,项目名称:commerce,代码行数:21,代码来源:BasicDaoMapper.php

示例3: returnLastBuiltDeleteQuery

 /**
  * Returns the last built SQL DELETE query with tabs removed.
  *
  * This function tries to retrieve the last built SQL DELETE query from the database object property $this->debug_lastBuiltQuery (works only since T3 3.8.0 with $GLOBALS['TYPO3_DB']->store_lastBuiltQuery = true). If this does not succeed, a fallback method is used (for former versions of class.\TYPO3\CMS\Core\Database\DatabaseConnection.php [TYPO3 3.6.0-3.8.0beta1] or $GLOBALS['TYPO3_DB']->store_lastBuiltQuery _not_ set to true) to retrieve the query string from \TYPO3\CMS\Core\Database\DatabaseConnection::DELETEquery() - as this is an overhead (\TYPO3\CMS\Core\Database\DatabaseConnection::DELETEquery() is called a second time after the call from \TYPO3\CMS\Core\Database\DatabaseConnection::exec_SELECT_query) IMO this should not be a permanent solution.
  *
  * @param   DatabaseConnection    TYPO3 database object (instance of \TYPO3\CMS\Core\Database\DatabaseConnection) used for last executed SQL query
  * @param   string      from clause/table name passed to last executed SQL query (see comment of \TYPO3\CMS\Core\Database\DatabaseConnection::exec_DELETEquery())
  * @param   string      where clause passed to last executed SQL query (see comment of \TYPO3\CMS\Core\Database\DatabaseConnection::exec_DELETEquery())
  * @return  string      last built SQL query with tabs removed
  * @see                 class.\TYPO3\CMS\Core\Database\DatabaseConnection.php, \TYPO3\CMS\Core\Database\DatabaseConnection::exec_DELETEquery()
  * @author  Rainer Kuhn 
  */
 public static function returnLastBuiltDeleteQuery(DatabaseConnection $dbObject, $from_table, $where_clause)
 {
     // try to get query from debug_lastBuiltQuery (works only for T3 3.8.0 with $GLOBALS['TYPO3_DB']->store_lastBuiltQuery = true)
     $query = $dbObject->debug_lastBuiltQuery;
     // fallback for former versions of class.\TYPO3\CMS\Core\Database\DatabaseConnection.php (TYPO3 3.6.0-3.8.0beta1) or $GLOBALS['TYPO3_DB']->store_lastBuiltQuery _not_ set to true
     if (strlen($query) < 1) {
         $query = $dbObject->DELETEquery($from_table, $where_clause);
     }
     // remove tabs and return query string
     return str_replace(chr(9), '', $query);
 }
开发者ID:punktde,项目名称:pt_extbase,代码行数:23,代码来源:Div.php

示例4: deleteQueryCreateValidQuery

 /**
  * @test
  *
  * @return void
  */
 public function deleteQueryCreateValidQuery()
 {
     $queryExpected = "DELETE FROM {$this->testTable} WHERE id=1";
     $queryGenerated = $this->subject->DELETEquery($this->testTable, 'id=1');
     $this->assertSame($queryExpected, $queryGenerated);
 }
开发者ID:dachcom-digital,项目名称:TYPO3.CMS,代码行数:11,代码来源:DatabaseConnectionTest.php


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