当前位置: 首页>>代码示例>>PHP>>正文


PHP ParseQuery::get方法代码示例

本文整理汇总了PHP中Parse\ParseQuery::get方法的典型用法代码示例。如果您正苦于以下问题:PHP ParseQuery::get方法的具体用法?PHP ParseQuery::get怎么用?PHP ParseQuery::get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Parse\ParseQuery的用法示例。


在下文中一共展示了ParseQuery::get方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: find

 /**
  * @param       $id
  * @param array $columns
  * @param array $keyToInclude
  *
  * @return ParseObject
  */
 public function find($id, $columns = ['*'], $keyToInclude = [])
 {
     for ($i = 0; $i < count($keyToInclude); $i++) {
         $this->query->includeKey($keyToInclude[$i]);
     }
     return $this->query->get($id, $this->useMasterKey);
 }
开发者ID:khangaikh,项目名称:golocal,代码行数:14,代码来源:AbstractParseRepository.php

示例2: dtestParseBytesFromBase64Data

 public function dtestParseBytesFromBase64Data()
 {
     $obj = ParseObject::create("TestObject");
     $bytes = ParseBytes::createFromBase64Data("R3JhbnRsYW5k");
     $obj->set("byteColumn", $bytes);
     $obj->save();
     $query = new ParseQuery("TestObject");
     $objAgain = $query->get($obj->getObjectId());
     $this->assertEquals("Grantland", $objAgain->get("byteColumn"));
 }
开发者ID:nidalb,项目名称:baas,代码行数:10,代码来源:ParseBytesTest.php

示例3: retrieveById

 /**
  * Retrieve a user by their unique identifier.
  *
  * @param  mixed $identifier
  *
  * @return \Illuminate\Contracts\Auth\Authenticatable|\LaraParse\Subclasses\User|null
  */
 public function retrieveById($identifier)
 {
     // check current user exist
     $currentUser = ParseUser::getCurrentUser();
     if ($currentUser->getObjectId() == $identifier) {
         return $currentUser;
     }
     $query = new ParseQuery('_User');
     return $query->get($identifier, true);
 }
开发者ID:redkyo017,项目名称:LaraParse,代码行数:17,代码来源:ParseUserProvider.php

示例4: getCarsOfUsers

 public function getCarsOfUsers($userObjectId)
 {
     $_user = new ParseQuery("_User");
     $_user->get($userObjectId);
     $user = $_user->find();
     $_car = new ParseQuery("Car");
     $_car->equalTo("owner", $user[0]);
     $cars = $_car->find();
     return $cars;
 }
开发者ID:oscarsmartwave,项目名称:l45fbl45t,代码行数:10,代码来源:Cars_model.php

示例5: testParseBytesFromBase64Data

 public function testParseBytesFromBase64Data()
 {
     $obj = ParseObject::create('BytesObject');
     $bytes = ParseBytes::createFromBase64Data('R3JhbnRsYW5k');
     $obj->set('byteColumn', $bytes);
     $obj->save();
     $query = new ParseQuery('BytesObject');
     $objAgain = $query->get($obj->getObjectId());
     $this->assertEquals('Grantland', $objAgain->get('byteColumn'));
 }
开发者ID:aglo35,项目名称:vr_beta,代码行数:10,代码来源:ParseBytesTest.php

示例6: store

 public function store(ValidateAddExpert $request)
 {
     $expert = new ParseObject("experts");
     $expert->set("name", $request->get('name'));
     $expert->set("email", $request->get('email'));
     $expert->set("password", bcrypt($request->get('password')));
     $cityID = $request->get('city');
     $c = new ParseQuery("Cities");
     $city = $c->get($cityID);
     $expert->set("city", $city);
     $expert->save();
     return \Redirect::route('addExpert')->with('message', 'Expert has been created');
 }
开发者ID:aktn,项目名称:Laravel_TripPlan,代码行数:13,代码来源:AdminController.php

示例7: retrieveById

 /**
  * Retrieve a user by their unique identifier.
  *
  * @param  mixed $identifier
  *
  * @return \Illuminate\Contracts\Auth\Authenticatable|\LaraParse\Subclasses\User|null
  */
 public function retrieveById($identifier)
 {
     $query = new ParseQuery('_User');
     try {
         return $query->get($identifier, true);
     } catch (ParseException $pex) {
         // Only return null if it's the object not found exception
         if ($pex->getCode() == self::PEX_OBJECT_NOT_FOUND) {
             return null;
         } else {
             throw $pex;
         }
     }
 }
开发者ID:Triztian,项目名称:LaraParse,代码行数:21,代码来源:ParseUserProvider.php

示例8: deleteAction

 /**
  * Finds the item by id and removes it. Redirects to the app (PRG) and uses the flash message to pass on any errors.
  */
 public function deleteAction()
 {
     if (!$this->request instanceof \Zend\Http\Request or !$this->request->isPost()) {
         return;
         //nothing to do
     }
     $query = new ParseQuery(self::PARSE_CLASS);
     try {
         $item = $query->get($this->request->getPost('id'));
         $item->destroy();
     } catch (ParseException $e) {
         $this->flashMessenger()->addErrorMessage($e->getMessage());
     }
     $this->redirect()->toRoute('app');
 }
开发者ID:mkhuramj,项目名称:ToDo-Web,代码行数:18,代码来源:AppController.php

示例9: fetchParseUser

 private function fetchParseUser($user_id)
 {
     $query = new ParseQuery("UserObject");
     $parseUser = "UserObjectDoesNotExist";
     try {
         $parseUser = $query->get($user_id);
         return $parseUser;
         // The object was retrieved successfully.
     } catch (ParseException $ex) {
         // The object was not retrieved successfully.
         // error is a ParseException with an error code and message.
         echo 'Kõik on katki!';
     }
     return $parseUser;
 }
开发者ID:aglo35,项目名称:vr_beta,代码行数:15,代码来源:Controller.php

示例10: update

 /**
  * Update the specified resource in storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function update()
 {
     try {
         ParseClient::initialize(env('PARSE_ID', 'fuck'), env('PARSE_REST', 'fuck'), env('PARSE_MASTER', 'fuck'));
         $condicoesJSON = Input::get('condicoes');
         $condicoes = json_decode($condicoesJSON);
         $protocoloId = Input::get('id');
         $protocoloQuery = new ParseQuery("Protocolo");
         $protocolo = $protocoloQuery->get($protocoloId);
         $condQuery = new ParseQuery("DescritivoMinimo");
         $condQuery->equalTo('protocolo', $protocolo);
         $condicoesFromServer = $condQuery->find();
         $condicoesArray = [];
         for ($serverIndex = 0; $serverIndex < count($condicoesFromServer); $serverIndex++) {
             $present = false;
             if (array_key_exists($serverIndex, $condicoesFromServer)) {
                 $keysArray = array_keys($condicoes);
                 for ($localIndex = 0; $localIndex < count($keysArray); $localIndex++) {
                     if (array_key_exists($keysArray[$localIndex], $condicoes)) {
                         if ($condicoes[$keysArray[$localIndex]]->id == $condicoesFromServer[$serverIndex]->getObjectId()) {
                             $present = true;
                             $condicoesFromServer[$serverIndex]->set('ordem', $condicoes[$keysArray[$localIndex]]->ordem);
                             $condicoesFromServer[$serverIndex]->save();
                             $condicoesArray[$condicoes[$keysArray[$localIndex]]->ordem] = $condicoesFromServer[$serverIndex]->getObjectId();
                             unset($condicoes[$keysArray[$localIndex]]);
                         }
                     }
                 }
                 if ($present == false) {
                     $condicoesFromServer[$serverIndex]->destroy();
                 }
             }
         }
         $keysArray = array_keys($condicoes);
         for ($index = 0; $index < count($keysArray); $index++) {
             $condicao = new ParseObject("DescritivoMinimo");
             $condicao->set('frase', $condicoes[$keysArray[$index]]->frase);
             $condicao->set('ordem', $condicoes[$keysArray[$index]]->ordem);
             $condicao->set('protocolo', $protocolo);
             $condicao->save();
             $condicoesArray[$condicoes[$keysArray[$index]]->ordem] = $condicao->getObjectId();
         }
         return json_encode($condicoesArray);
     } catch (ParseException $error) {
         dd($error);
         return $error;
     }
 }
开发者ID:pietrodegrazia,项目名称:regulaSUSWeb,代码行数:54,代码来源:DescritivoController.php

示例11: get

 public function get($className, $objectId)
 {
     $query = new ParseQuery($className);
     try {
         $parseObject = $query->get($objectId);
         $parseObject->status = 1;
         return $parseObject;
     } catch (ParseException $e) {
         $this->lastError = $e;
         $errorObject = new stdClass();
         $errorObject->status = 0;
         $errorObject->code = $e->getCode();
         $errorObject->message = $e->getMessage();
         return $errorObject;
     }
 }
开发者ID:alamops,项目名称:codeigniter-parse-library,代码行数:16,代码来源:parse.php

示例12: showHome

 public function showHome(Request $request)
 {
     $current_user = ParseUser::getCurrentUser();
     if (!$current_user) {
         return redirect()->route('login');
     }
     $query = ParseUser::query();
     $current_user = $query->get($current_user->getObjectId());
     Html\Assets::addLink(Html\Link::Css(elixir('css/default.css')));
     Html\Assets::addMetaTag(Html\Meta::Tag('description', ''));
     $query = new ParseQuery("ChatRoom");
     $query->equalTo('members', $current_user);
     try {
         $chatRooms = $query->find();
         $query = new ParseQuery("Messages");
         $query->containedIn("chatRoom", $chatRooms);
         $query->descending('createdAt');
         $query->includeKey('chatRoom');
         $query->includeKey('user');
         $query->limit(20);
         $messages = $query->find();
         $data = [];
         foreach ($messages as $message) {
             $chatRoom = $message->get('chatRoom');
             $event = $chatRoom->get('event');
             $evQuery = new ParseQuery('Events');
             $evQuery->includeKey('group');
             $event = $evQuery->get($event->getObjectId());
             $group = $event->get('group');
             $relation = $message->getRelation("asset");
             $aqry = $relation->getQuery();
             $assets = $aqry->find();
             $temp = ['group' => $group, 'event' => $event, 'chatRoom' => $chatRoom, 'message' => ['msg' => $message, 'assets' => $assets], 'user' => $message->get('user')];
             $data[] = $temp;
         }
     } catch (ParseException $ex) {
         // The object was not retrieved successfully.
         // error is a ParseException with an error code and message.
         echo $ex->getMessage();
     }
     $renderData = $this->getRenderData($request);
     $renderData['user'] = $current_user;
     $renderData['activeBarTab'] = "dashboard";
     $renderData['data'] = $data;
     return view('home', $renderData);
 }
开发者ID:samphomsopha,项目名称:codelab,代码行数:46,代码来源:HomeController.php

示例13: save

 public function save(Request $request)
 {
     $current_user = ParseUser::getCurrentUser();
     $name = $request->input('name');
     $assetId = $request->input('assetId');
     $current_user->set('name', $name);
     try {
         if (!empty($assetId)) {
             $query = new ParseQuery("Assets");
             $asset = $query->get($assetId);
             if (!empty($asset)) {
                 $current_user->set('image', $asset->get('file'));
             }
         }
         $current_user->save();
     } catch (\Exception $ex) {
         echo 'Failed to create new object, with error message: ' . $ex->getMessage();
     }
     return redirect()->route('profile');
 }
开发者ID:samphomsopha,项目名称:codelab,代码行数:20,代码来源:ProfileController.php

示例14: showUploader

 public function showUploader($roomId, Request $request)
 {
     $current_user = ParseUser::getCurrentUser();
     if (!$current_user) {
         return redirect()->route('login');
     }
     $message = $request->input('msg');
     Html\Assets::addLink(Html\Link::Css('/vendor/dropzone/dropzone.css'));
     Html\Assets::addLink(Html\Link::Css(elixir('css/default.css')));
     Html\Assets::addLink(Html\Link::Script('//www.parsecdn.com/js/parse-1.6.7.min.js'));
     Html\Assets::addLink(Html\Link::Script('/vendor/dropzone/dropzone.js'));
     Html\Assets::addLink(Html\Link::Script(elixir('scripts/chatUploader.js')));
     Html\Assets::addMetaTag(Html\Meta::Tag('description', ''));
     $query = new ParseQuery("ChatRoom");
     $chatObj = $query->get($roomId);
     $renderData = $this->getRenderData($request);
     $renderData['user'] = $current_user;
     $renderData['chatObj'] = $chatObj;
     $renderData['message'] = $message;
     return view('chatUploader', $renderData);
 }
开发者ID:samphomsopha,项目名称:codelab,代码行数:21,代码来源:ChatController.php

示例15: retrieveById

 /**
  * Retrieve a user by their unique identifier.
  *
  * @param  mixed $identifier
  *
  * @return \Illuminate\Contracts\Auth\Authenticatable|\LaraParse\Subclasses\User|null
  */
 public function retrieveById($identifier)
 {
     $query = new ParseQuery('_User');
     return $query->get($identifier, true);
 }
开发者ID:khangaikh,项目名称:golocal,代码行数:12,代码来源:ParseUserProvider.php


注:本文中的Parse\ParseQuery::get方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。