<commit_before><?php
class UserGroupsFilter extends MergeableFilter{
	
	public function __construct(){
		parent::__construct(Tbl::get('TBL_GROUPS', 'UserManager'), "grps", "id");
		
		$this->qb->select(new Field("*", $this->primaryTableAlias))
			->from($this->primaryTable, $this->primaryTableAlias);
		
	}
	
	public function setId($id){
		if(empty($id) or !is_numeric($id)){
			throw new InvalidIntegerArgumentException("\$id have to be non zero integer");
		}
		
		$this->qb->andWhere($this->qb->expr()->equal(new Field('id', $this->primaryTableAlias), $id));
		return $this;
	}
	
	public function setName($name){
		if(empty($name)){
			throw new InvalidIntegerArgumentException("\$name have to be not empty string");
		}
	
		$this->qb->andWhere($this->qb->expr()->equal(new Field('name', $this->primaryTableAlias), $name));
		return $this;
	}
	
	public function setUser(User $user){
		$this->joinUsersGroupsTable();
		
		$this->qb->andWhere($this->qb->expr()->equal(new Field('user_id', 'users_groups'), $user->id));
		return $this;
	}
	
	
	protected function joinUsersGroupsTable(){
		$this->qb->leftJoin(Tbl::get('TBL_USERS_GROUPS', 'UserManager'),	'users_groups',
				$this->qb->expr()->equal(new Field('id', $this->primaryTableAlias), new Field('group_id', 'users_groups')));
	}
	
}<commit_msg>Added some functionality to UserGroupsFilter<commit_after><?php
class UserGroupsFilter extends MergeableFilter{
	
	public function __construct(){
		parent::__construct(Tbl::get('TBL_GROUPS', 'UserManager'), "grps", "id");
		
		$this->qb->select(new Field("*", $this->primaryTableAlias))
			->from($this->primaryTable, $this->primaryTableAlias);
		
	}
	
	public function setId($id){
		if(empty($id) or !is_numeric($id)){
			throw new InvalidIntegerArgumentException("\$id have to be non zero integer");
		}
		
		$this->qb->andWhere($this->qb->expr()->equal(new Field('id', $this->primaryTableAlias), $id));
		return $this;
	}
	
	public function setIdIn($ids){
		if(empty($ids) or !is_array($ids)){
			throw new InvalidIntegerArgumentException("\$ids have to be non empty array");
		}
	
		$this->qb->andWhere($this->qb->expr()->in(new Field('id', $this->primaryTableAlias), $ids));
		return $this;
	}
	
	public function setIdNotIn($ids){
		if(empty($ids) or !is_array($ids)){
			throw new InvalidIntegerArgumentException("\$ids have to be non empty array");
		}
	
		$this->qb->andWhere($this->qb->expr()->notIn(new Field('id', $this->primaryTableAlias), $ids));
		return $this;
	}
	
	public function setName($name){
		if(empty($name)){
			throw new InvalidIntegerArgumentException("\$name have to be not empty string");
		}
	
		$this->qb->andWhere($this->qb->expr()->equal(new Field('name', $this->primaryTableAlias), $name));
		return $this;
	}
	
	public function setUser(User $user){
		$this->joinUsersGroupsTable();
		
		$this->qb->andWhere($this->qb->expr()->equal(new Field('user_id', 'users_groups'), $user->id));
		return $this;
	}
	
	
	protected function joinUsersGroupsTable(){
		$this->qb->leftJoin(Tbl::get('TBL_USERS_GROUPS', 'UserManager'),	'users_groups',
				$this->qb->expr()->equal(new Field('id', $this->primaryTableAlias), new Field('group_id', 'users_groups')));
	}
	
}
{'fraction_non_alphanumeric': 0.19567262464722485, 'fraction_numerical': 0.0, 'mean_word_length': 5.41851106639839, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 77, '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': '1689026', 'n_tokens_mistral': 1159, 'n_tokens_neox': 1045, 'n_words': 206}