Example #1
0
 if (!$object->_id) {
     $msg = $object->store();
     if ($msg) {
         CAppUI::setMsg($msg, UI_MSG_ERROR);
         $results[$i]["error"] = $msg;
         $i++;
         continue;
     }
     CAppUI::setMsg("Favori créé", UI_MSG_OK);
 }
 $tag_name = $results[$i]["tag"];
 if ($tag_name) {
     $tag = new CTag();
     $tag->name = $tag_name;
     $tag->object_class = $object->_class;
     $tag->loadMatchingObjectEsc();
     if (!$tag->_id) {
         $msg = $tag->store();
         if ($msg) {
             CAppUI::setMsg($msg, UI_MSG_ERROR);
             $results[$i]["error"] = $msg;
             $i++;
             continue;
         }
     }
     $tag_item = new CTagItem();
     $tag_item->tag_id = $tag->_id;
     $tag_item->object_id = $object->_id;
     $tag_item->object_class = $object->_class;
     $tag_item->loadMatchingObjectEsc();
     if (!$tag_item->_id) {