本文整理汇总了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));
}