本文整理汇总了PHP中Pack::find方法的典型用法代码示例。如果您正苦于以下问题:PHP Pack::find方法的具体用法?PHP Pack::find怎么用?PHP Pack::find使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Pack
的用法示例。
在下文中一共展示了Pack::find方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: view
public function view($id = null)
{
if (empty($id)) {
redirect('charts');
} else {
if (Ranked_file::count(array('conditions' => array('id = ?', $id))) == 0) {
redirect('charts');
} else {
error_reporting(E_ALL ^ E_DEPRECATED ^ E_NOTICE ^ E_WARNING);
$file = Ranked_file::find($id);
$pack = Pack::find($file->pack_id);
$this->data['user_scores'] = User_score::get_scores_for_chart($id);
$this->data['pack'] = $pack;
$this->data['subtitle'] = $file->title;
$this->_process_everything($file->raw_file, $file->rate);
}
}
}
示例2: get_single_pack_info
public static function get_single_pack_info($id)
{
return Pack::find(array("select" => "`packs`.*, (SELECT COUNT(*) FROM `ranked_files` WHERE `ranked_files`.`pack_id` = `packs`.`id`) AS file_count", "conditions" => array("id = ?", $id)));
}
示例3: delete_pack
function delete_pack($pack_id)
{
if (Pack::count(array('conditions' => array('id = ?', $pack_id))) != 1) {
redirect('home');
}
$this->content_view = "mod/delete_pack_success";
$pack = Pack::find($pack_id);
$pack_name = $pack->name;
$pack->delete();
$log_string = $this->session->userdata('username') . " (" . $this->session->userdata('display_name') . ") deleted pack: " . $pack_name;
write_to_mod_log($log_string);
}