mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-12-25 18:30:53 +00:00
make_table_with_key_is_id function added to replace and use for like filling the category array, I guess it will be used in the future for a lot of different things
This commit is contained in:
parent
306357d552
commit
3dbf4a63ce
2 changed files with 10 additions and 5 deletions
|
@ -16,4 +16,13 @@ class Gui_Elements{
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function make_table_with_key_is_id( $inputList, $funcArray, $idFunction){
|
||||||
|
$result = Array();
|
||||||
|
foreach($inputList as $element){
|
||||||
|
foreach($funcArray as $function){
|
||||||
|
$result[$element->$idFunction()] = $element->$function();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -29,11 +29,7 @@ function createticket(){
|
||||||
//create array of category id & names
|
//create array of category id & names
|
||||||
global $cfg;
|
global $cfg;
|
||||||
$catArray = Ticket_Category::getAllCategories($cfg['db']['lib']);
|
$catArray = Ticket_Category::getAllCategories($cfg['db']['lib']);
|
||||||
$result['category'] = Array();
|
$result['category'] = Gui_Elements::make_table_with_key_is_id($catArray, Array("getName"), "getTCategoryId" );
|
||||||
foreach($catArray as $catObj){
|
|
||||||
$result['category'][$catObj->getTCategoryId()] = $catObj->getName();
|
|
||||||
}
|
|
||||||
|
|
||||||
return $result;
|
return $result;
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
|
|
Loading…
Reference in a new issue