public function add($complaint, $lang, $parent = null)
 {
     $model = new complaintModel();
     $model->parent_id = $parent;
     $model->save();
     $dict = new dictModel();
     $dict->table_name = $this->_table;
     $dict->table_id = $model->id;
     $dict->lang = $lang;
     $dict->body = $complaint;
     return $dict->save();
 }
Beispiel #2
0
 public function add($desc, $lang, $book, $remedium)
 {
     $model = new descModel();
     $model->remedium_id = $remedium;
     $model->book_id = $book;
     $model->save();
     $dict = new dictModel();
     $dict->table_name = $this->_table;
     $dict->table_id = $model->id;
     $dict->lang = $lang;
     $dict->body = $desc;
     return $dict->save();
 }
 public function add($modality, $betterORworse, $lang, $book, $remedium = null, $complaint = null)
 {
     $model = new modalityModel();
     $model->remedium_id = $remedium;
     $model->complaint_id = $complaint;
     $model->book_id = $book;
     $model->modality = $betterORworse;
     $model->save();
     $dict = new dictModel();
     $dict->table_name = $this->_table;
     $dict->table_id = $model->id;
     $dict->lang = $lang;
     $dict->body = $modality;
     return $dict->save();
 }
 $html = iconv('iso8859-2', 'utf-8', $html);
 $html = str_replace(['ć', 'Ć', 'œ'], ['e', 'AE', 'e'], $html);
 $b = [];
 if (preg_match_all('~<p align="justify">(.+?)</p>~si', $html, $b)) {
     foreach ($b[1] as $h) {
         $h = unhtml($h);
         $h = explode('.--', $h);
         if (count($h) == 1) {
             $desc = new descModel();
             $d = $desc->find('en', $book->id, $remedium->id);
             if (!$d) {
                 $desc->add($h[0], 'en', $book->id, $remedium->id);
             } else {
                 $dict = new dictModel($d);
                 $dict->body = $h[0];
                 $dict->save();
             }
         }
         if (count($h) == 2) {
             $complaint = new complaintModel();
             $complaint_name = strtolower($h[0]);
             if (strlen($complaint_name) > 25) {
                 mydie($complaint_name);
             }
             switch ($complaint_name) {
                 case 'relationship':
                     break;
                 case 'dose':
                     break;
                 case 'modalities':
                     foreach (explode('.', $h[1]) as $modal) {