本文整理匯總了PHP中SwatDB::updateColumn方法的典型用法代碼示例。如果您正苦於以下問題:PHP SwatDB::updateColumn方法的具體用法?PHP SwatDB::updateColumn怎麽用?PHP SwatDB::updateColumn使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類SwatDB
的用法示例。
在下文中一共展示了SwatDB::updateColumn方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: processActions
protected function processActions(SwatTableView $view, SwatActions $actions)
{
$num = count($view->getSelection());
$message = null;
switch ($actions->selected->id) {
case 'delete':
$this->app->replacePage('MetaData/Delete');
$this->app->getPage()->setItems($view->checked_items);
break;
case 'show_details':
SwatDB::updateColumn($this->app->db, 'PinholeMetaData', 'boolean:visible', true, 'id', $view->getSelection());
$message = new SwatMessage(sprintf(Pinhole::ngettext('One detail has been enabled.', '%s details have been enabled.', $num), SwatString::numberFormat($num)));
break;
case 'dont_show_details':
SwatDB::updateColumn($this->app->db, 'PinholeMetaData', 'boolean:visible', false, 'id', $view->getSelection());
$message = new SwatMessage(sprintf(Pinhole::ngettext('One detail has been disabled.', '%s details have been disabled.', $num), SwatString::numberFormat($num)));
break;
case 'show_machine':
SwatDB::updateColumn($this->app->db, 'PinholeMetaData', 'boolean:machine_tag', true, 'id', $view->getSelection());
$message = new SwatMessage(sprintf(Pinhole::ngettext('One machine tag has been enabled.', '%s machine tags have been enabled.', $num), SwatString::numberFormat($num)));
break;
case 'dont_show_machine':
SwatDB::updateColumn($this->app->db, 'PinholeMetaData', 'boolean:machine_tag', false, 'id', $view->getSelection());
$message = new SwatMessage(sprintf(Pinhole::ngettext('One machine tag has been disabled.', '%s machine tags have been disabled.', $num), SwatString::numberFormat($num)));
break;
}
if ($message !== null) {
$this->app->messages->add($message);
}
}
示例2: saveIndex
protected function saveIndex($id, $index)
{
SwatDB::updateColumn($this->app->db, 'BlorgAuthor', 'integer:displayorder', $index, 'integer:id', array($id));
$instance_id = $this->app->getInstanceId();
$sql = sprintf('update BlorgAuthor set displayorder = %s
where id = %s and instance %s %s', $this->app->db->quote($index, 'integer'), $this->app->db->quote($id, 'integer'), SwatDB::equalityOperator($instance_id), $this->app->db->quote($instance_id, 'integer'));
SwatDB::exec($this->app->db, $sql);
if (isset($this->app->memcache)) {
$this->app->memcache->flushNs('authors');
}
}
示例3: saveIndex
protected function saveIndex($id, $index)
{
SwatDB::updateColumn($this->app->db, 'Block', 'integer:displayorder', $index, 'integer:id', array($id));
}