当前位置: 首页>>代码示例>>PHP>>正文


PHP Pack::count方法代码示例

本文整理汇总了PHP中Pack::count方法的典型用法代码示例。如果您正苦于以下问题:PHP Pack::count方法的具体用法?PHP Pack::count怎么用?PHP Pack::count使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Pack的用法示例。


在下文中一共展示了Pack::count方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: view

 public function view($id = null)
 {
     if (empty($id)) {
         redirect('packs');
     } else {
         if (Pack::count(array('conditions' => array('id = ?', $id))) == 0) {
             redirect('packs');
         } else {
             $this->data['pack'] = Pack::get_single_pack_info($id);
             $this->data['subtitle'] = $this->data['pack']->name;
             $this->data['songs'] = Ranked_file::all(array('conditions' => array("pack_id = ?", $id), 'order' => "rate ASC"));
             if (isset($_GET['recalc'])) {
                 error_reporting(E_ALL ^ E_DEPRECATED ^ E_NOTICE ^ E_WARNING);
                 set_time_limit(0);
                 foreach ($this->data['songs'] as $file) {
                     $calculated_difficulty = $this->_process_everything($file->raw_file, $file->rate);
                     $file->difficulty_score = $calculated_difficulty;
                 }
             }
             $this->content_view = 'packs/view';
         }
     }
 }
开发者ID:samoldenburg,项目名称:Stepmania-Leaderboards,代码行数:23,代码来源:Packs.php

示例2: packname_unique

 public function packname_unique($pack_name)
 {
     $this->set_message('packname_unique', "The pack you're trying to enter already exists.");
     return Pack::count(array('conditions' => array('name = ?', $pack_name))) == 0;
 }
开发者ID:samoldenburg,项目名称:Stepmania-Leaderboards,代码行数:5,代码来源:MY_Form_validation.php

示例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);
 }
开发者ID:samoldenburg,项目名称:Stepmania-Leaderboards,代码行数:12,代码来源:Mod.php


注:本文中的Pack::count方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。