/** * Creates fully populated objects out of an item array. * * @param array $items Array of items in the same format as that returned from get_items(). * @return mixed Array of item objects og null if failed. */ public function populate(array $groups) { if (!is_array($groups)) { return null; } $return_objects = array(); $socatalog = bim_socatalog::get_instance(); foreach ($groups as $group) { $group_obj = new bim_bogroup(); $group_obj->set_bpn($group['bpn']); $group_obj->set_name($group['name']); $group_obj->set_nat_group_no($group['ngno']); $group_obj->set_catalog($socatalog->get($group['catalog_id'])); $return_objects[] = $group_obj; } return $return_objects; }