public function set_attribute($attr_def, bim_boattribute $attr)
 {
     $group_attrs = $this->group->get_attribute_list();
     if (array_key_exists($attr_def, $group_attrs)) {
         $this->attributes[$attr_def] = $attr;
         return true;
     }
     // Return false if array key (the attr definition) doesn't exist in group.
     return false;
 }
 /**
  * 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;
 }