Exemplo n.º 1
0
 public function dtgRoleUserList_Bind()
 {
     $this->dtgRoleUserList->TotalItemCount = NarroUserRole::CountByRoleId($this->objRole->RoleId);
     // Because we want to enable pagination AND sorting, we need to setup the $objClauses array to send to LoadAll()
     // Setup the $objClauses Array
     $objClauses = array();
     // If a column is selected to be sorted, and if that column has a OrderByClause set on it, then let's add
     // the OrderByClause to the $objClauses array
     if ($objClause = $this->dtgRoleUserList->OrderByClause) {
         array_push($objClauses, $objClause);
     }
     // Add the LimitClause information, as well
     if ($objClause = $this->dtgRoleUserList->LimitClause) {
         array_push($objClauses, $objClause);
     }
     // Set the DataSource to be the array of all NarroUser objects, given the clauses above
     $this->dtgRoleUserList->DataSource = NarroUserRole::LoadArrayByRoleId($this->objRole->RoleId, $objClauses);
     QApplication::ExecuteJavaScript('highlight_datagrid();');
 }
Exemplo n.º 2
0
 /**
  * Counts all associated NarroUserRolesAsRole
  * @return int
  */
 public function CountNarroUserRolesAsRole()
 {
     if (is_null($this->intRoleId)) {
         return 0;
     }
     return NarroUserRole::CountByRoleId($this->intRoleId);
 }