本文整理汇总了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);
}
示例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();
}
示例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();
}
示例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);
}
示例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();
}
示例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());
}
示例7: _onDeleteBefore
protected function _onDeleteBefore()
{
CM_Db_Db::delete('cm_languageValue', array('languageKeyId' => $this->getId()));
}
示例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);
}
示例9: _onDelete
protected function _onDelete()
{
CM_Db_Db::delete('cm_model_language', array('id' => $this->getId()));
}
示例10: deleteExpired
public static function deleteExpired()
{
CM_Db_Db::delete('cm_session', '`expires` < ' . time());
}
示例11: reset
public function reset()
{
CM_Db_Db::delete('cm_user_preference', array('userId' => $this->_model->getId()));
$this->_change();
}
示例12: delete
public function delete($recursive = null)
{
CM_Db_Db::delete('cm_tmp_userfile', array('uniqid' => $this->getUniqid()));
parent::delete();
}
示例13: _delete
private function _delete()
{
CM_Db_Db::delete('cm_captcha', array('captcha_id' => $this->getId()));
}
示例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');
}
}
示例15: deleteOlder
/**
* @param int $age Seconds
*/
public static function deleteOlder($age)
{
$age = (int) $age;
CM_Db_Db::delete('cm_action', '`createStamp` < ' . (time() - $age));
}