<commit_before>package EnsEMBL::ORM::Rose::Manager::Group;

### NAME: EnsEMBL::ORM::Rose::Manager::Group
### Module to handle multiple Group entries 

### DESCRIPTION:
### Enables fetching, counting, etc., of multiple Rose::Object::Group objects

use strict;
use warnings;

use EnsEMBL::ORM::Rose::Object::Group;

use base qw(EnsEMBL::ORM::Rose::Manager::Trackable);

sub object_class { 'EnsEMBL::ORM::Rose::Object::Group' }

sub fetch_with_members {
  ## Fetchs group(s) with given id(s) along with it's members
  ## @param Group id OR ArrayRef of group ids if multiple groups
  ## @param Flag if on, will return the active only users
  ## @return Rose::Object drived object, or arrayref of same if arrayref of ids provided as argument
  my ($self, $ids, $active_only) = @_;
  
  return unless $ids;
  
  my $method          = ref $ids eq 'ARRAY' ? 'fetch_by_primary_keys' : 'fetch_by_primary_key';
  my $params          = {'with_objects' => ['membership', 'membership.user'], 'sort_by' => 'user.name'};
  $params->{'query'}  = ['membership.member_status', 'active'] if $active_only;

  return $self->$method($ids, $params);
}

1;<commit_msg>membership object has two status columns<commit_after>package EnsEMBL::ORM::Rose::Manager::Group;

### NAME: EnsEMBL::ORM::Rose::Manager::Group
### Module to handle multiple Group entries 

### DESCRIPTION:
### Enables fetching, counting, etc., of multiple Rose::Object::Group objects

use strict;
use warnings;

use EnsEMBL::ORM::Rose::Object::Group;

use base qw(EnsEMBL::ORM::Rose::Manager::Trackable);

sub object_class { 'EnsEMBL::ORM::Rose::Object::Group' }

sub fetch_with_members {
  ## Fetchs group(s) with given id(s) along with it's members
  ## @param Group id OR ArrayRef of group ids if multiple groups
  ## @param Flag if on, will return the active only users
  ## @return Rose::Object drived object, or arrayref of same if arrayref of ids provided as argument
  my ($self, $ids, $active_only) = @_;
  
  return unless $ids;
  
  my $method          = ref $ids eq 'ARRAY' ? 'fetch_by_primary_keys' : 'fetch_by_primary_key';
  my $params          = {'with_objects' => ['membership', 'membership.user'], 'sort_by' => 'user.name'};
  $params->{'query'}  = ['membership.member_status', 'active', 'membership.status', 'active'] if $active_only;

  return $self->$method($ids, $params);
}

1;
{'fraction_non_alphanumeric': 0.15315699658703072, 'fraction_numerical': 0.0008532423208191126, 'mean_word_length': 5.02827763496144, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5100055', 'n_tokens_mistral': 788, 'n_tokens_neox': 748, 'n_words': 224}