本文整理汇总了PHP中Varien_Db_Adapter_Interface::truncateTable方法的典型用法代码示例。如果您正苦于以下问题:PHP Varien_Db_Adapter_Interface::truncateTable方法的具体用法?PHP Varien_Db_Adapter_Interface::truncateTable怎么用?PHP Varien_Db_Adapter_Interface::truncateTable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Varien_Db_Adapter_Interface
的用法示例。
在下文中一共展示了Varien_Db_Adapter_Interface::truncateTable方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: truncateResources
protected function truncateResources()
{
$resourcesTables = $this->prepareResourcesTables($this->resources);
foreach ($resourcesTables as $resourceTable) {
$this->dbWrite->truncateTable($resourceTable);
}
return $resourcesTables;
}
示例2: truncateResourceGroups
/**
* Loop through resource groups and truncate tables
*
* @return void
*/
protected function truncateResourceGroups()
{
foreach ($this->groups as $name => $resources) {
$this->prepareResources($resources);
if (!count($resources)) {
continue;
}
array_walk($resources, array($this, 'prepareArrayForTableOutput'));
if (!$this->force) {
$this->output->writeln(sprintf('<info>%s</info> table(s):', $name));
$table = new Table($this->output);
$table->setRows($resources)->render();
$confirm = $this->dialog->askConfirmation($this->output, '<question>Truncate table(s)?</question> ', false);
if (!$confirm) {
continue;
}
}
foreach ($resources as $resourceName) {
if (!$resourceName[0]) {
continue;
}
$this->dbWrite->truncateTable($resourceName[0]);
$this->output->writeln(sprintf('Truncate <info>%s</info>', $resourceName[0]));
}
}
}