/**
  * @remotable
  */
 protected function qolScore()
 {
     //grab the qolscore from the systemref table
     $q = Doctrine_Query::create()->select('s.name')->from('SystemRef s')->where("s.refType = 'qolscore'");
     $q->execute();
     $result = $q->execute(array(), Doctrine::HYDRATE_ARRAY);
     //Check for existing record
     $q2 = Doctrine_Query::create()->select('q.orgID')->from('QolScoreValue q')->where("q.orgID = ?", $this->getOrgID());
     $q2->execute();
     if ($result2 = $q2->execute(array(), Doctrine::HYDRATE_ARRAY)) {
     } else {
         //insert values into the qolscore table
         foreach ($result as $key => $value) {
             //return $key."-".$value['name'];
             //insert into qolscore value table
             $qolScore = new QolScoreValue();
             $qolScore->score = $value['name'];
             $qolScore->orgID = $this->getOrgID();
             $qolScore->isActive = 1;
             $qolScore->rTime = $this->getDateFormat();
             $qolScore->rUser = $this->getUserID();
             $qolScore->save();
         }
     }
 }
 public function defaultQolScoreValue()
 {
     //grab the QOL values from the systemref table
     $q = Doctrine_Query::create()->select('s.name')->from('SystemRef s')->where("s.refType = 'qolscore'");
     $q->execute();
     $result = $q->execute(array(), Doctrine::HYDRATE_ARRAY);
     //insert values into the QOL table
     foreach ($result as $key => $value) {
         //return $key."-".$value['name'];
         //insert into activitiy value table
         $qolScore = new QolScoreValue();
         $qolScore->score = $value['name'];
         $qolScore->scoreDesc = $value['scoreDesc'];
         $qolScore->orgID = 16;
         $qolScore->isActive = 1;
         $qolScore->rTime = date("d/m/y : H:i:s", time());
         $qolScore->rUser = $this->getUserID();
         $qolScore->save();
     }
 }