Advertisement
Guest User

Untitled

a guest
May 6th, 2016
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.55 KB | None | 0 0
  1. /**
  2. * Insert new collection into project, using same mongoId in every project
  3. */
  4. public function updateReportTemplates()
  5. {
  6. try{
  7. $guid = '2345mttsv-k65g-p03u-jlchw34bphphiiuu';
  8. $mongoDB = WServices::getDbo($guid, true);
  9. $mongoDB->collection = $mongoDB->getMongoDBCollection('report_templates');
  10. $mongoDB->collection->update(
  11. array(),
  12. array('$set' =>array(
  13. "_id" => new \MongoId("5718b8161c284934afc8d7d1"),
  14. "name" => "JLIB_BIMEYE_REPORT_TYPE_ONE",
  15. "report_type" => "Rapports",
  16. "type" => "1"
  17. )
  18. ));
  19.  
  20. $mongoDB->collection->update(
  21. array(),
  22. array('$set' =>array(
  23. "_id" => new \MongoId("5718c19e1c284934afc8d7e4"),
  24. "name" => "JLIB_BIMEYE_REPORT_TYPE_TWO",
  25. "report_type" => "RevisionRapports",
  26. "type" => "2"
  27. )
  28. ));
  29.  
  30. $mongoDB->collection->update(
  31. array(),
  32. array('$set' =>array(
  33. "_id" => new \MongoId("5718c1af1c284934afc8d7e5"),
  34. "name" => "JLIB_BIMEYE_REPORT_TYPE_THREE",
  35. "report_type" => "PM",
  36. "type" => "3"
  37. )
  38. ));
  39. }
  40. catch (\Exception $e)
  41. {
  42. return json_encode(array(self::ERROR => json_encode($e->getMessage())));
  43. }
  44.  
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement