<commit_before><?php

class User {

	private $_userInstance;

	public function __construct($userId)
    {
        if (strlen($userId)==0){
            $this->_userInstance = $this->createUser();
        } else {
            $this->_userInstance = CcSubjsQuery::create()->findPK($userId);
        } 
    }

	public function getId() {
        return $this->_userInstance->getDbId();
	}

	public function isHost($showId) {
        $userId = $this->_userInstance->getDbId();
		return CcShowHostsQuery::create()->filterByDbShow($showId)->filterByDbHost($userId)->count() > 0;
	}

	public function isAdmin() {
        return $this->_userInstance->getDbType() === 'A';
	}
    
    public function setLogin($login){
 		$user = $this->_userInstance;
		$user->setDbLogin($login); 
    }
     
    public function setPassword($password){
 		$user = $this->_userInstance;
		$user->setDbPass(md5($password));     
    }
    
    public function setFirstName($firstName){
 		$user = $this->_userInstance;
		$user->setDbFirstName($firstName);   
    }
    
    public function setLastName($lastName){
 		$user = $this->_userInstance;
		$user->setDbLastName($lastName);      
    }
    
    public function setType($type){
 		$user = $this->_userInstance;
		$user->setDbType($type);  
    }

    public function setEmail($email){
	    $user = $this->_userInstance;
	    $user->setDbEmail($email);   
    }

    public function setSkype($skype){
	    $user = $this->_userInstance;
	    $user->setDbSkypeContact($skype);   
    }

    public function setJabber($jabber){
	    $user = $this->_userInstance;
	    $user->setDbJabberContact($jabber);   
    }
    
    public function getLogin(){
 		$user = $this->_userInstance;
		return $user->getDbLogin();       
    }    
    
    public function getPassword(){
 		$user = $this->_userInstance;
		return $user->getDbPass();       
    }
    
    public function getFirstName(){
 		$user = $this->_userInstance;
		return $user->getDbFirstName();          
    }
    
    public function getLastName(){
 		$user = $this->_userInstance;
		return $user->getDbLastName();           
    }
    
    public function getType(){
 		$user = $this->_userInstance;
		return $user->getDbType();          
    }

    public function getEmail(){
	    $user = $this->_userInstance;
        return $user->getDbEmail();	    
    }

    public function getSkype(){
	    $user = $this->_userInstance;
        return $user->getDbSkypeContact();	    
    }

    public function getJabber(){
	    $user = $this->_userInstance;
        return $user->getDbJabberContact();	    
 
    }
    
    public function save(){
        $this->_userInstance->save();
    }
    
    public function delete(){
        if (!$this->_userInstance->isDeleted())
            $this->_userInstance->delete();
    }

	private function createUser() {
		$user = new CcSubjs();        
        return $user;
	}

	public static function getUsers($type, $search=NULL) {
		global $CC_DBC;

		$sql;

		$sql_gen = "SELECT id AS value, login AS label FROM cc_subjs ";
		$sql = $sql_gen;
		
		if(is_array($type)) {
			for($i=0; $i<count($type); $i++) {
				$type[$i] = "type = '{$type[$i]}'";
			}
			$sql_type = join(" OR ", $type);
		}
		else {
			$sql_type = "type = {$type}";
		}
		
		$sql = $sql_gen ." WHERE (". $sql_type.")";
	
		if(!is_null($search)) {
			$like = "login ILIKE '%{$search}%'";

			$sql = $sql . " AND ".$like." ORDER BY login";
		}
	
		return  $CC_DBC->GetAll($sql);	
	}

	public static function getHosts($search=NULL) {
		return User::getUsers(array('H'), $search);
	}
    <commit_msg>ordering by login<commit_after><?php

class User {

	private $_userInstance;

	public function __construct($userId)
    {
        if (strlen($userId)==0){
            $this->_userInstance = $this->createUser();
        } else {
            $this->_userInstance = CcSubjsQuery::create()->findPK($userId);
        } 
    }

	public function getId() {
        return $this->_userInstance->getDbId();
	}

	public function isHost($showId) {
        $userId = $this->_userInstance->getDbId();
		return CcShowHostsQuery::create()->filterByDbShow($showId)->filterByDbHost($userId)->count() > 0;
	}

	public function isAdmin() {
        return $this->_userInstance->getDbType() === 'A';
	}
    
    public function setLogin($login){
 		$user = $this->_userInstance;
		$user->setDbLogin($login); 
    }
     
    public function setPassword($password){
 		$user = $this->_userInstance;
		$user->setDbPass(md5($password));     
    }
    
    public function setFirstName($firstName){
 		$user = $this->_userInstance;
		$user->setDbFirstName($firstName);   
    }
    
    public function setLastName($lastName){
 		$user = $this->_userInstance;
		$user->setDbLastName($lastName);      
    }
    
    public function setType($type){
 		$user = $this->_userInstance;
		$user->setDbType($type);  
    }

    public function setEmail($email){
	    $user = $this->_userInstance;
	    $user->setDbEmail($email);   
    }

    public function setSkype($skype){
	    $user = $this->_userInstance;
	    $user->setDbSkypeContact($skype);   
    }

    public function setJabber($jabber){
	    $user = $this->_userInstance;
	    $user->setDbJabberContact($jabber);   
    }
    
    public function getLogin(){
 		$user = $this->_userInstance;
		return $user->getDbLogin();       
    }    
    
    public function getPassword(){
 		$user = $this->_userInstance;
		return $user->getDbPass();       
    }
    
    public function getFirstName(){
 		$user = $this->_userInstance;
		return $user->getDbFirstName();          
    }
    
    public function getLastName(){
 		$user = $this->_userInstance;
		return $user->getDbLastName();           
    }
    
    public function getType(){
 		$user = $this->_userInstance;
		return $user->getDbType();          
    }

    public function getEmail(){
	    $user = $this->_userInstance;
        return $user->getDbEmail();	    
    }

    public function getSkype(){
	    $user = $this->_userInstance;
        return $user->getDbSkypeContact();	    
    }

    public function getJabber(){
	    $user = $this->_userInstance;
        return $user->getDbJabberContact();	    
 
    }
    
    public function save(){
        $this->_userInstance->save();
    }
    
    public function delete(){
        if (!$this->_userInstance->isDeleted())
            $this->_userInstance->delete();
    }

	private function createUser() {
		$user = new CcSubjs();        
        return $user;
	}

	public static function getUsers($type, $search=NULL) {
		global $CC_DBC;

		$sql;

		$sql_gen = "SELECT id AS value, login AS label FROM cc_subjs ";
		$sql = $sql_gen;
		
		if(is_array($type)) {
			for($i=0; $i<count($type); $i++) {
				$type[$i] = "type = '{$type[$i]}'";
			}
			$sql_type = join(" OR ", $type);
		}
		else {
			$sql_type = "type = {$type}";
		}
		
		$sql = $sql_gen ." WHERE (". $sql_type.") ORDER BY login";
	
		if(!is_null($search)) {
			$like = "login ILIKE '%{$search}%'";

			$sql = $sql . " AND ".$like." ORDER BY login";
		}
	
		return  $CC_DBC->GetAll($sql);	
	}

	public static function getHosts($search=NULL) {
		return User::getUsers(array('H'), $search);
	}
    
{'fraction_non_alphanumeric': 0.16205698401667826, 'fraction_numerical': 0.0011118832522585128, 'mean_word_length': 2.598, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 109, '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': '6931771', 'n_tokens_mistral': 2522, 'n_tokens_neox': 2351, 'n_words': 437}