Jump to content

patrickhertling

New Members
  • Posts

    3
  • Joined

  • Last visited

patrickhertling's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I dont think it matters, but from a database query. Its a joomla site and there is a function called "loadObjectList()".
  2. Hehe, sorry about that. Please let me explain again: We have an array of stdClass elements: array(element_1, element_2, ..., element_n) Each element is like: element_k : {order: int, name: "name", group_name: "name", group_order: int} Ok. Now I want to build an array / stdClass based data structure like followes: array:[group_1 : {name : "name", order : int, items : [ item_1 : {name : "name", order : int }, ... item_n : {...} ] }, ... group_n : {...} ] I was thinking doing it in a loop, but maybe there is a better way. Thank you very much for your time. Regards Patrick
  3. Hi. I would like to build a complex data structure in a foreach bucle and return it after foreach ($array as $row) { // Here we get groupname and item_info for each row. } I want an array of groups(stdClass). Each group has info, and a list of items(stdClass). array( stdClass Group_1 ( info list = array ( stdClass item_1 ( info ) stdClass item_2 (..) ... ) ) ... stdClass Group_n (...) ) Any help to build this would be apreciated. Thank you.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.