Esempio n. 1
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;
     }
 }