示例#1
0
             $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) {
                 $msg = $tag_item->store();
                 if ($msg) {
                     CAppUI::setMsg($msg, UI_MSG_ERROR);
                     $results[$i]["error"] = $msg;
                     $i++;
                     continue;
                 }
             }
         }
     }
     $results[$i]["code"] = implode(" - ", $results[$i]["code"]);
     $i++;
 }
 fclose($fp);