private function _setActiveCompany($ccmp_id){

         if(Yii::app()->getModule('user')->user()->profile->ccmp_id != $ccmp_id){
            //update 
            $sSql = "
                UPDATE profiles 
                SET ".$this->profiles_ccmp_field." = ".$ccmp_id." 
                WHERE 
                    user_id = ".Yii::app()->getModule('user')->user()->id
                ;
            Yii::app()->db->createCommand($sSql)->query();             
         }

         $this->_activeCompany = $ccmp_id;
         
         //set comapny name
         foreach($this->getClientCompanies() as $company){
             if($ccmp_id == $company['ccmp_id']){
                 //$this->_company_attributes =  array_merge( $company->ccucCcmp->attributes,$company->ccucCcmp->cccdCustomData->attributes);                 
                 $sql = "
                    SELECT 
                        * 
                    FROM
                        ccmp_company inner 
                        JOIN cccd_custom_data 
                          ON ccmp_id = cccd_ccmp_id 
                    WHERE ccmp_id = ".$ccmp_id."
                    ";
                 $this->_company_attributes = Yii::app()->db->createCommand($sql)->queryRow();
                 $this->_activeCompanyName = $this->_company_attributes['ccmp_name'];
                 return TRUE;
             }
         }
         throw new CHttpException(404, "For ccmp_id=".$ccmp_id. "neatrada nosaukumu");
     }