public function getSubdomainsForApp($dataprovider)
 {
     $subs = array();
     foreach ($dataprovider->getData() as $sub) {
         $temp = array();
         $temp["id"] = $sub->id;
         $temp["name"] = $sub->name;
         $temp["description"] = $sub->description;
         $temp["need"] = $sub->need;
         $d = new UserDomain();
         $d->subdomain_id = $sub->id;
         $temp["mentors"] = UserDomain::model()->getMentorsFromSubdomain($d->search());
         $subs[] = $temp;
     }
     return $subs;
 }
 public function getDomainsForApp($dataprovider)
 {
     $domains = array();
     foreach ($dataprovider->getData() as $domain) {
         $temp = array();
         $temp["id"] = $domain->id;
         $temp["name"] = $domain->name;
         $temp["description"] = $domain->description;
         $temp["need"] = $domain->need;
         $d = new UserDomain();
         $d->domain_id = $domain->id;
         $temp["mentors"] = UserDomain::model()->getMentorsFromDomain($d->search());
         $subs = new Subdomain();
         $subs->domain_id = $domain->id;
         $temp["subdomains"] = Subdomain::model()->getSubdomainsForApp($subs->setCriteriaForApp(), $domain->id);
         $domains[] = $temp;
     }
     return $domains;
 }