Esempio n. 1
0
 /**
  * needs workerId in postdata.
  */
 public function postUnflag()
 {
     try {
         $return = array('status' => 'ok');
         $this->authenticateUser();
         $workerid = Input::get('workerid');
         $crowdagent = CrowdAgent::where('_id', $workerid)->first();
         $crowdagent->unflag();
         $return['message'] = "Unflagged worker {$workerid} successfully.";
     } catch (Exception $e) {
         $return['message'] = $e->getMessage();
         $return['status'] = 'bad';
     }
     return $return;
 }
Esempio n. 2
0
 private function createCrowdAgent()
 {
     if ($id = CrowdAgent::where('platformAgentId', $workerId)->where('softwareAgent_id', $this->softwareAgent_id)->pluck('_id')) {
         return $id;
     } else {
         $agent = new CrowdAgent();
         $agent->_id = "crowdagent/{$platform}/{$workerId}";
         $agent->softwareAgent_id = $platform;
         $agent->platformAgentId = $workerId;
         $agent->save();
         return $agent->_id;
     }
 }
Esempio n. 3
0
 public function getA()
 {
     //Queue::push('Queues\UpdateUnits', array("entity/text/medical/relex-structured-sentence/1078"));
     $ca = CrowdAgent::where("_id", "crowdagent/cf/14781069")->first();
     Queue::push('Queues\\UpdateCrowdAgent', array('crowdagent' => serialize($ca)));
 }