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


PHP role::get_array方法代码示例

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


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

示例1: __construct

 public function __construct($id = 0, $role_object = null, $show_history = false)
 {
     $database = $_SESSION['database'];
     $this->id = $id;
     $this->roles = array();
     $this->listing = array();
     if ($id != 0) {
         $id = $database->prepare_input($id);
         $projects_query = $database->query("SELECT projects_name, projects_description, projects_customers_contact_name, projects_customers_reference, projects_start_date, projects_end_date, projects_calculated_hours, projects_calculated_hours_period, business_units_id, customers_id FROM " . TABLE_PROJECTS . " WHERE projects_id = '" . (int) $id . "';");
         $projects_result = $database->fetch_array($projects_query);
         if (tep_not_null($projects_result)) {
             // Project exists
             $this->fill($projects_result['projects_name'], $projects_result['projects_description'], $projects_result['projects_customers_contact_name'], $projects_result['projects_customers_reference'], tep_datetouts(DATE_FORMAT_DATABASE, $projects_result['projects_start_date']), $projects_result['projects_end_date'] != '2099-12-31' ? tep_datetouts(DATE_FORMAT_DATABASE, $projects_result['projects_end_date']) : 0, $projects_result['projects_calculated_hours'], $projects_result['projects_calculated_hours_period'], $projects_result['business_units_id'], $projects_result['customers_id']);
             // Retrieve specific role or all available roles for this project
             if (tep_not_null($role_object)) {
                 if (is_object($role_object)) {
                     $this->roles[sizeof($this->roles)] = $role_object;
                 }
             } else {
                 $temp_role = new role();
                 // Create a default role (id==0)
                 $this->roles = $temp_role->get_array($this->id);
             }
         }
     } else {
         // We probably created an empty project object to retrieve the entire project listing
         $this->listing = $this->get_array($show_history);
     }
 }
开发者ID:BackupTheBerlios,项目名称:bitts-svn,代码行数:29,代码来源:project.php


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