Example #1
0
 /**
  * Returns the language in the system, by locale. If there was no this locale in the system, tries to find
  * other language with the same ISO code, if there was no this language installed returns the default one 'en-GB'
  *
  * @param  $locale - string locale in format: <language>_<TRANSLATION>
  * @return Zend_Db_Table_Row_Abstract
  */
 public function find($locale = null)
 {
     if ($locale == null || strlen($locale) < 5) {
         return parent::find($this->_defaultLocale);
     }
     $rows = parent::find($locale);
     if ($rows->count() !== 0) {
         return $rows;
     }
     list($language, $translation) = explode('_', $locale);
     $rows = $this->fetchAll($this->select()->where("iso LIKE '" . $language . "_%'"));
     if ($rows->count() !== 0) {
         return $rows;
     }
     return parent::find($this->_defaultLocale);
 }
Example #2
0
 /**
  * this sets the runstatus
  *
  */
 public function setRunStatus($status)
 {
     $where = "id = 1";
     $data['runstatus'] = $status;
     return parent::update($data, $where);
 }
Example #3
0
 /**
  * @param mixed $id - primary key value
  * @return array
  */
 public function getToGUI($id)
 {
     $data = parent::find($id)->current();
     $data = $this->convertToGUI($data);
     return $data;
 }