protected function fillObject($data)
 {
     $object = parent::fillObject($data);
     $model = new processedmealoptionsetModel();
     $optionset = $model->getfromId($object->getOptionsetid());
     if (count($optionset) == 1) {
         $optionset = $optionset[0];
         $object->setOptionset($optionset->getName());
         $object->setOptionsettype($optionset->getOptionsettypeid());
     }
     return $object;
 }
Пример #2
0
 public function deleteoptionset($parameters = array())
 {
     $sure = $parameters['sure'];
     $model = new processedmealoptionsetModel();
     $optionset = $model->getfromId($parameters['id']);
     if (count($optionset) == 1) {
         $optionset = $optionset[0];
         if ($sure != 'sure') {
             $template = new ui($this);
             $template->assign('optionset', $optionset);
             return $template->fetch('mycafetaria_confirmdeleteoptionset.tpl');
         } else {
             $cond = array('id' => array('mode' => '=', 'value' => $optionset->getId()));
             $model->delete($cond);
             return true;
         }
     }
 }