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


PHP CM_Db_Db::delete方法代码示例

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


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

示例1: flush

 public function flush()
 {
     CM_Db_Db::delete('cm_svmtraining', array('svmId' => $this->getId()));
     CM_Db_Db::replace('cm_svm', array('id' => $this->getId(), 'updateStamp' => time()));
     $file = $this->_getFile();
     $file->delete();
     $this->__construct($this->_id);
 }
开发者ID:cargomedia,项目名称:cm,代码行数:8,代码来源:Model.php

示例2: reload

 public function reload(CM_OutputStream_Interface $output)
 {
     $tableNames = CM_Db_Db::exec('SHOW TABLES')->fetchAllColumn();
     CM_Db_Db::exec('SET foreign_key_checks = 0;');
     foreach ($tableNames as $table) {
         CM_Db_Db::delete($table);
     }
     CM_Db_Db::exec('SET foreign_key_checks = 1;');
     $this->_setInitialVersion();
 }
开发者ID:cargomedia,项目名称:cm,代码行数:10,代码来源:SetupScript.php

示例3: remove

 /**
  * @param string $phrase
  */
 public function remove($phrase)
 {
     $languageKey = CM_Model_LanguageKey::findByName($phrase);
     if (!$languageKey) {
         return;
     }
     CM_Db_Db::delete('cm_languageValue', array('languageKeyId' => $languageKey->getId(), 'languageId' => $this->_language->getId()));
     $this->_change();
     (new self($this->_language, !$this->_javascriptOnly))->_change();
 }
开发者ID:cargomedia,项目名称:cm,代码行数:13,代码来源:All.php

示例4: queueOutstanding

 public function queueOutstanding()
 {
     $executeAtMax = time();
     $result = CM_Db_Db::select('cm_jobdistribution_delayedqueue', '*', '`executeAt` <= ' . $executeAtMax, '`executeAt` ASC');
     while ($row = $result->fetch()) {
         $job = $this->_instantiateJob($row['className']);
         if ($job) {
             $job->queue(CM_Params::decode($row['params'], true));
         }
     }
     CM_Db_Db::delete('cm_jobdistribution_delayedqueue', '`executeAt` <= ' . $executeAtMax);
 }
开发者ID:cargomedia,项目名称:cm,代码行数:12,代码来源:DelayedQueue.php

示例5: testCache

 public function testCache()
 {
     $source = new CM_PagingSource_Sql('`num`', 'test');
     $source->enableCache();
     $this->assertSame(100, $source->getCount());
     $sourceNocache = new CM_PagingSource_Sql('`num`', 'test');
     $this->assertSame(100, $sourceNocache->getCount());
     CM_Db_Db::delete('test', array('num' => 0));
     $this->assertSame(100, $source->getCount());
     $this->assertSame(99, $sourceNocache->getCount());
     $source->clearCache();
     $this->assertSame(99, $source->getCount());
     $this->assertSame(99, $sourceNocache->getCount());
     CM_Cache_Shared::getInstance()->flush();
 }
开发者ID:NicolasSchmutz,项目名称:cm,代码行数:15,代码来源:AbstractTest.php

示例6: testCacheCustom

 public function testCacheCustom()
 {
     $source = new CM_PagingSource_Sql('`num`', 'test');
     $fileCache = CM_Cache_Persistent::getInstance();
     $source->enableCache(null, $fileCache);
     $this->assertEquals(100, $source->getCount());
     CM_Db_Db::delete('test', array('num' => 0));
     $this->assertEquals(100, $source->getCount());
     $source->clearCache();
     $this->assertEquals(99, $source->getCount());
     CM_Db_Db::delete('test', array('num' => 1));
     $this->assertEquals(99, $source->getCount());
     $fileCache->flush();
     $this->assertEquals(98, $source->getCount());
 }
开发者ID:cargomedia,项目名称:cm,代码行数:15,代码来源:AbstractTest.php

示例7: _onDeleteBefore

 protected function _onDeleteBefore()
 {
     CM_Db_Db::delete('cm_languageValue', array('languageKeyId' => $this->getId()));
 }
开发者ID:cargomedia,项目名称:cm,代码行数:4,代码来源:LanguageKey.php

示例8: _upgradeRegionList

 protected function _upgradeRegionList()
 {
     $this->_streamOutput->writeln('Updating regions database…');
     $count = $this->_count(array($this->_regionListByCountryRenamed, $this->_regionListByCountryUpdatedCode, $this->_regionListByCountryAdded, $this->_regionListByCountryRemovedCodeInUse), 3);
     $item = 0;
     foreach ($this->_regionListByCountryRenamed as $countryCode => $regionListRenamed) {
         foreach ($regionListRenamed as $regionCode => $regionNames) {
             $regionName = $regionNames['name'];
             $maxMindRegion = $countryCode . $regionCode;
             if (!CM_Db_Db::update('cm_model_location_state', array('name' => $regionName), array('_maxmind' => $maxMindRegion))) {
                 // For the USA, where the old numeric region codes in _maxmind have been removed from MaxMind's newer region databases
                 $countryId = $this->_countryIdList[$countryCode];
                 CM_Db_Db::update('cm_model_location_state', array('name' => $regionName), array('countryId' => $countryId, 'abbreviation' => $regionCode));
             }
             $this->_printProgressCounter(++$item, $count);
         }
     }
     unset($this->_regionListByCountryRenamed);
     foreach ($this->_regionListByCountryUpdatedCode as $countryCode => $regionListUpdatedCode) {
         foreach ($regionListUpdatedCode as $regionCode) {
             $regionId = $this->_regionIdListByCountry[$countryCode][$regionCode];
             $maxMindRegion = $countryCode . $regionCode;
             $abbreviationRegion = 'US' === $countryCode ? $regionCode : null;
             CM_Db_Db::update('cm_model_location_state', array('_maxmind' => $maxMindRegion, 'abbreviation' => $abbreviationRegion), array('id' => $regionId));
             $this->_printProgressCounter(++$item, $count);
         }
     }
     unset($this->_regionListByCountryUpdatedCode);
     foreach ($this->_regionListByCountryAdded as $countryCode => $regionListAdded) {
         $countryId = $this->_countryIdList[$countryCode];
         $country = new CM_Model_Location(CM_Model_Location::LEVEL_COUNTRY, $countryId);
         foreach ($regionListAdded as $regionCode => $regionName) {
             $abbreviationRegion = 'US' === $countryCode ? $regionCode : null;
             $maxMindRegion = $countryCode . $regionCode;
             $region = CM_Model_Location::createState($country, $regionName, $abbreviationRegion, $maxMindRegion);
             $regionId = $region->getId();
             $this->_regionIdListByCountry[$countryCode][$regionCode] = $regionId;
             if (isset($this->_locationTree[$countryCode]['regions'][$regionCode]['location']['maxMind'])) {
                 $maxMind = $this->_locationTree[$countryCode]['regions'][$regionCode]['location']['maxMind'];
                 $this->_regionIdListByMaxMind[$maxMind] = $regionId;
             }
             $this->_printProgressCounter(++$item, $count);
         }
     }
     unset($this->_regionListByCountryAdded);
     foreach ($this->_regionListByCountryRemovedCodeInUse as $countryCode => $regionListRemovedCodeInUse) {
         foreach ($regionListRemovedCodeInUse as $regionIdOld => $regionCode) {
             CM_Db_Db::delete('cm_model_location_state', array('id' => $regionIdOld));
             $regionId = $this->_regionIdListByCountry[$countryCode][$regionCode];
             CM_Db_Db::update('cm_model_location_city', array('stateId' => $regionId), array('stateId' => $regionIdOld));
             $this->_printProgressCounter(++$item, $count);
         }
     }
     unset($this->_regionListByCountryRemovedCodeInUse);
 }
开发者ID:cargomedia,项目名称:cm,代码行数:55,代码来源:MaxMind.php

示例9: _onDelete

 protected function _onDelete()
 {
     CM_Db_Db::delete('cm_model_language', array('id' => $this->getId()));
 }
开发者ID:cargomedia,项目名称:cm,代码行数:4,代码来源:Language.php

示例10: deleteExpired

 public static function deleteExpired()
 {
     CM_Db_Db::delete('cm_session', '`expires` < ' . time());
 }
开发者ID:cargomedia,项目名称:cm,代码行数:4,代码来源:Session.php

示例11: reset

 public function reset()
 {
     CM_Db_Db::delete('cm_user_preference', array('userId' => $this->_model->getId()));
     $this->_change();
 }
开发者ID:cargomedia,项目名称:cm,代码行数:5,代码来源:Preferences.php

示例12: delete

 public function delete($recursive = null)
 {
     CM_Db_Db::delete('cm_tmp_userfile', array('uniqid' => $this->getUniqid()));
     parent::delete();
 }
开发者ID:NicolasSchmutz,项目名称:cm,代码行数:5,代码来源:Temp.php

示例13: _delete

 private function _delete()
 {
     CM_Db_Db::delete('cm_captcha', array('captcha_id' => $this->getId()));
 }
开发者ID:NicolasSchmutz,项目名称:cm,代码行数:4,代码来源:Captcha.php

示例14: _onDelete

 protected function _onDelete()
 {
     try {
         CM_Db_Db::delete('cm_streamChannel', array('id' => $this->getId()));
     } catch (CM_Db_Exception $e) {
         throw new CM_Exception_Invalid('Cannot delete streamChannel with existing streams');
     }
 }
开发者ID:cargomedia,项目名称:cm,代码行数:8,代码来源:Abstract.php

示例15: deleteOlder

 /**
  * @param int $age Seconds
  */
 public static function deleteOlder($age)
 {
     $age = (int) $age;
     CM_Db_Db::delete('cm_action', '`createStamp` < ' . (time() - $age));
 }
开发者ID:NicolasSchmutz,项目名称:cm,代码行数:8,代码来源:Abstract.php


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