本文整理汇总了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);
}
}