本文整理匯總了PHP中PHPWS_DB::reduceColumn方法的典型用法代碼示例。如果您正苦於以下問題:PHP PHPWS_DB::reduceColumn方法的具體用法?PHP PHPWS_DB::reduceColumn怎麽用?PHP PHPWS_DB::reduceColumn使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類PHPWS_DB
的用法示例。
在下文中一共展示了PHPWS_DB::reduceColumn方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: delete
public function delete()
{
$db = new PHPWS_DB('signup_slots');
$db->addWhere('id', $this->id);
if (PHPWS_Error::logIfError($db->delete())) {
return false;
}
$db->reset();
$db->addWhere('s_order', $this->s_order, '>');
$db->reduceColumn('s_order', 1);
return true;
}
示例2: delete
public function delete($permanent = false)
{
$db = new PHPWS_DB('ps_page');
$db->addWhere('id', $this->id);
if ($permanent) {
$result = $db->delete();
if (PHPWS_Error::logIfError($result)) {
return false;
}
Key::drop($this->key_id);
$db = new PHPWS_DB('ps_text');
$db->addWhere('pid', $this->id);
$result = $db->delete();
$db = new PHPWS_DB('ps_block');
$db->addWhere('pid', $this->id);
$db->delete();
} else {
$db->addValue('deleted', 1);
$db->addValue('last_updated', time());
$result = $db->update();
if (PHPWS_Error::logIfError($result)) {
return false;
}
$key = new \Key($this->key_id);
$key->active = 0;
$key->save();
$key->unregister();
}
$this->removeShortcuts();
if ($this->parent_page) {
$db = new PHPWS_DB('ps_page');
$db->addWhere('parent_page', $this->parent_page);
$db->addWhere('page_order', $this->page_order, '>');
PHPWS_Error::logIfError($db->reduceColumn('page_order'));
}
return true;
}
示例3: delete
public function delete()
{
$db = new PHPWS_DB('ps_page');
$db->addWhere('id', $this->id);
$result = $db->delete();
if (PHPWS_Error::logIfError($result)) {
return false;
}
Key::drop($this->key_id);
$db = new PHPWS_DB('ps_text');
$db->addWhere('pid', $this->id);
$db->delete();
$db = new PHPWS_DB('ps_block');
$db->addWhere('pid', $this->id);
$db->delete();
if ($this->parent_page) {
$db = new PHPWS_DB('ps_page');
$db->addWhere('parent_page', $this->parent_page);
$db->addWhere('page_order', $this->page_order, '>');
PHPWS_Error::logIfError($db->reduceColumn('page_order'));
}
$this->removeShortcuts();
return true;
}