本文整理汇总了PHP中Location_Model::count方法的典型用法代码示例。如果您正苦于以下问题:PHP Location_Model::count方法的具体用法?PHP Location_Model::count怎么用?PHP Location_Model::count使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Location_Model
的用法示例。
在下文中一共展示了Location_Model::count方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
function __construct()
{
$this->conf = array('path' => 'admin/schedules');
parent::__construct(User_model::LEVEL_MANAGER);
/* check how many locations do we have */
$lm = new Location_Model();
$location_count = $lm->count();
$this->data['location_count'] = $location_count;
/* check how many staff do we have */
$um = new User_Model();
$staff_count = $um->count_staff();
$this->data['staff_count'] = $staff_count;
$um = new User_Model();
$staffs = $um->get()->all;
$this->data['staffs'] = array();
foreach ($staffs as $sta) {
$this->data['staffs'][$sta->id] = $sta;
}
/* also get all shift templates */
$shift_template_titles = array();
$stm = new Shift_Template_Model();
$stm->get();
foreach ($stm->get() as $st) {
// $shift_template_titles[ $st->start . '-' . $st->end ] = $st->name;
}
$this->data['shift_template_titles'] = $shift_template_titles;
}
示例2: array
function __construct()
{
$this->conf = array('model' => 'Shift_model', 'path' => 'admin/shifts', 'entity' => 'shift', 'after_save' => 'shift');
parent::__construct(User_model::LEVEL_MANAGER);
/* check how many locations do we have */
$lm = new Location_Model();
$location_count = $lm->count();
$this->data['location_count'] = $location_count;
}
示例3: view_text
public function view_text($skip = array())
{
$return = parent::view_text($skip);
unset($return['start']);
unset($return['end']);
unset($return['status']);
$return['date'][1] = $this->date_view($skip);
/* optimize it sometime later */
$lm = new Location_Model();
$location_count = $lm->count();
if ($location_count < 2) {
unset($return['location']);
}
return $return;
}
示例4: array
function __construct()
{
$this->conf = array('path' => 'wall');
parent::__construct();
$this->load->library('hc_time');
/* check user level */
$remote_integration = $this->remote_integration();
if ($remote_integration) {
$user_level = 0;
} else {
$user_level = $this->app_conf->get('wall_schedule_display');
}
if ($user_level) {
$this->check_level($user_level);
}
/* check how many locations do we have */
$lm = new Location_Model();
$location_count = $lm->count();
$this->data['location_count'] = $location_count;
}