示例#1
0
 public function save()
 {
     $religionId = $this->getValue('religionId');
     if (!empty($religionId)) {
         $religion = $this->getReligionService()->getReligionById($religionId);
     } else {
         $religion = new Religion();
     }
     $religion->setCode($this->getValue('code'));
     $religion->setName($this->getValue('name'));
     $religion->save();
 }
示例#2
0
 public static function getReligions()
 {
     $dados = Database::ReadAll("religion", "*");
     if (!$dados) {
         return '';
     }
     foreach ($dados as $dado) {
         $religion = new Religion();
         $religion->setId($dado['ID_RELIGION']);
         $religion->setName($dado['NAME_RELIGION']);
         $religions[] = $religion;
     }
     return $religions;
 }