Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Insert new collection into project, using same mongoId in every project
- */
- public function updateReportTemplates()
- {
- try{
- $guid = '2345mttsv-k65g-p03u-jlchw34bphphiiuu';
- $mongoDB = WServices::getDbo($guid, true);
- $mongoDB->collection = $mongoDB->getMongoDBCollection('report_templates');
- $mongoDB->collection->update(
- array(),
- array('$set' =>array(
- "_id" => new \MongoId("5718b8161c284934afc8d7d1"),
- "name" => "JLIB_BIMEYE_REPORT_TYPE_ONE",
- "report_type" => "Rapports",
- "type" => "1"
- )
- ));
- $mongoDB->collection->update(
- array(),
- array('$set' =>array(
- "_id" => new \MongoId("5718c19e1c284934afc8d7e4"),
- "name" => "JLIB_BIMEYE_REPORT_TYPE_TWO",
- "report_type" => "RevisionRapports",
- "type" => "2"
- )
- ));
- $mongoDB->collection->update(
- array(),
- array('$set' =>array(
- "_id" => new \MongoId("5718c1af1c284934afc8d7e5"),
- "name" => "JLIB_BIMEYE_REPORT_TYPE_THREE",
- "report_type" => "PM",
- "type" => "3"
- )
- ));
- }
- catch (\Exception $e)
- {
- return json_encode(array(self::ERROR => json_encode($e->getMessage())));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement