本文整理汇总了PHP中Period::get_where方法的典型用法代码示例。如果您正苦于以下问题:PHP Period::get_where方法的具体用法?PHP Period::get_where怎么用?PHP Period::get_where使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Period
的用法示例。
在下文中一共展示了Period::get_where方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: edit
public function edit()
{
$this->_select_teacher_menu_pagetag('periods');
$this->parser->add_js_file('translation_selector.js');
$this->parser->add_js_file('admin_periods/form.js');
$this->parser->add_js_file('admin_periods/edit.js');
$uri = $this->uri->ruri_to_assoc(3);
$period_id = isset($uri['period_id']) ? intval($uri['period_id']) : 0;
$period = new Period();
$period->get_where(array('id' => $period_id));
$this->parser->parse('backend/periods/edit.tpl', array('period' => $period));
}
示例2: move_down
/**
* This method will move current period down in sorting order.
*/
public function move_down()
{
if (isset($this->id) && intval($this->id) > 0) {
$down_period = new Period();
$down_period->order_by('sorting', 'asc')->limit(1);
$down_period->where('sorting >', $this->sorting);
$down_period->get();
if ($down_period->exists()) {
$upsort = $down_period->sorting;
$down_period->sorting = $this->sorting;
if ($down_period->save()) {
$my_period = new Period();
$my_period->get_where(array('id' => $this->id));
$my_period->sorting = $upsort;
if ($my_period->save()) {
$this->sorting = $upsort;
}
}
}
}
}