Ejemplo n.º 1
0
        $member->url = '';
        $member->legacyId = new MongoInt32($m['id']);
        $member->roleId = Prefs::getRoleId('Merchant');
        $member->save();
    }
});
Route::get('parsetest', function () {
    ParseClient::initialize('lNz2h3vr3eJK9QMAKOLSaIvETaQWsbFJ8Em32TIw', '8QQoPiTZTkqSMkYLQQxHiaKBXO6Jq7iD2dCJjGUz', '2bKlPqYIKMpW1rJOdpBXQ8pf7cMXxGaFKrCXMr19');
    $query = ParseInstallation::query();
    //$query = new ParseInstallationQuery();
    $results = $query->find('*');
    foreach ($results as $r) {
        $p = Parsedevice::where('objectId', '=', $r->getObjectId())->first();
        if ($p) {
        } else {
            $p = new Parsedevice();
            $p->objectId = $r->getObjectId();
            $p->createdAt = $r->getCreatedAt();
        }
        $p->JEXDeviceId = $r->get('JEXDeviceId');
        $p->appIdentifier = $r->get('appIdentifier');
        $p->appName = $r->get('appName');
        $p->appVersion = $r->get('appVersion');
        $p->deviceBrand = $r->get('deviceBrand');
        $p->deviceType = $r->get('deviceType');
        $p->installationId = $r->get('installationId');
        $p->parseVersion = $r->get('parseVersion');
        $p->timeZone = $r->get('timeZone');
        $p->updatedAt = $r->getUpdatedAt();
        $p->save();
    }
 public function postSyncparse()
 {
     ParseClient::initialize(Config::get('parse.app_id'), Config::get('parse.rest_key'), Config::get('parse.master_key'));
     $query = ParseInstallation::query();
     //$query = new ParseInstallationQuery();
     $results = $query->find('*');
     $count = 0;
     foreach ($results as $r) {
         $count++;
         $p = Parsedevice::where('objectId', '=', $r->getObjectId())->first();
         if ($p) {
         } else {
             $p = new Parsedevice();
             $p->objectId = $r->getObjectId();
             $p->createdAt = $r->getCreatedAt();
         }
         $p->JEXDeviceId = $r->get('JEXDeviceId');
         $p->appIdentifier = $r->get('appIdentifier');
         $p->appName = $r->get('appName');
         $p->appVersion = $r->get('appVersion');
         $p->deviceBrand = $r->get('deviceBrand');
         $p->deviceType = $r->get('deviceType');
         $p->installationId = $r->get('installationId');
         $p->parseVersion = $r->get('parseVersion');
         $p->timeZone = $r->get('timeZone');
         $p->updatedAt = $r->getUpdatedAt();
         $p->save();
     }
     return Response::json(array('result' => 'OK', 'count' => $count));
 }