當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Parse\ParseQuery類代碼示例

本文整理匯總了PHP中Parse\ParseQuery的典型用法代碼示例。如果您正苦於以下問題:PHP ParseQuery類的具體用法?PHP ParseQuery怎麽用?PHP ParseQuery使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了ParseQuery類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: addTask

 public function addTask(Request $request)
 {
     $parseTask = new ParseObject("Task");
     $parseCropQuery = new ParseQuery("Crop");
     $parseCropQuery->equalTo("cropName", $request->input('crop'));
     $crop = $parseCropQuery->first();
     $parseQuery = new ParseQuery("Task");
     $parseQuery->equalTo("cropName", $crop);
     $parseQuery->equalTo("taskDesc", $request->input('taskName'));
     if ($parseQuery->count() > 0) {
         return redirect('/tasks');
     }
     $parseTask->set("cropName", $crop);
     $parseTask->set("taskDesc", $request->input('taskName'));
     $parseTask->set("taskDuration", $request->input('taskDuration'));
     $parseTask->set("taskStart", $request->input('taskStart'));
     try {
         $parseTask->save();
         \Session::put('message', 1);
         return redirect('tasks');
     } catch (ParseException $e) {
         \Session::put('message', -1);
         return redirect('tasks');
     }
 }
開發者ID:whizdummy,項目名稱:Farmers-Plaza-Web,代碼行數:25,代碼來源:TasksController.php

示例2: operators

 public function operators()
 {
     $query = new ParseQuery("_User");
     $query->equalTo("isOperator", true);
     $results["operators"] = $query->find();
     return $results;
 }
開發者ID:oscarsmartwave,項目名稱:l45fbl45t,代碼行數:7,代碼來源:Earnings_model.php

示例3: getUserCompanies

 public function getUserCompanies($user)
 {
     $query = new ParseQuery(self::$parseClassName);
     $query->equalTo("users", $user);
     $results = $query->find();
     return $results;
 }
開發者ID:EpykOS,項目名稱:eelh,代碼行數:7,代碼來源:CompanyRepository.php

示例4: getById

 public function getById($objectId)
 {
     $query = new ParseQuery($this->getClassName());
     $query->equalTo('objectId', $objectId);
     $results = $query->first();
     return $results;
 }
開發者ID:EpykOS,項目名稱:eelh,代碼行數:7,代碼來源:BaseRepository.php

示例5: getSleepers

function getSleepers()
{
    $query = new ParseQuery("BagTransaction");
    $query->equalTo("status", "active");
    $results = $query->find();
    return $results;
}
開發者ID:justingil1748,項目名稱:HackBag,代碼行數:7,代碼來源:funcs.php

示例6: getSeekers

function getSeekers()
{
    $query = new ParseQuery("_User");
    $query->equalTo("seeking", true);
    $results = $query->find();
    return $results;
}
開發者ID:justingil1748,項目名稱:HackBag,代碼行數:7,代碼來源:funcs.php

示例7: clearClass

 public static function clearClass($class)
 {
     $query = new ParseQuery($class);
     $query->each(function (ParseObject $obj) {
         $obj->destroy(true);
     }, true);
 }
開發者ID:ActiveWebsite,項目名稱:BoojPressPlugins,代碼行數:7,代碼來源:Helper.php

示例8: query

 public function query()
 {
     //iniciamos una consulta para recibir todos los usuarios ausentes de la sede del mentor logueado
     $query = new ParseQuery("Asistencia");
     $query->equalTo('Sede', array("__type" => "Pointer", "className" => "Sedes", "objectId" => $_SESSION['sede']));
     $query->includeKey('Usuario_FK');
     $results = $query->find();
     $listado = array();
     for ($i = 0; $i < count($results); $i++) {
         $object = $results[$i];
         $usuario = $object->get('Usuario_FK');
         $persona = array("ID" => $object->getObjectId(), 'Nombre' => $usuario->get("Nombre"), "Apellido" => $usuario->get("Apellido"), "Presente" => $object->get("Presente"));
         array_push($listado, $persona);
     }
     //definimos una función para ordenar el array con nuestros parámetros
     function custom_sort($a, $b)
     {
         return $a['Nombre'] > $b['Nombre'];
     }
     //ordenamos el array
     usort($listado, "custom_sort");
     //transformamos a json
     $json = json_encode($listado);
     echo $json;
 }
開發者ID:vorenusCoA,項目名稱:App_Asistencia,代碼行數:25,代碼來源:QueryManager.php

示例9: __construct

 public function __construct($objectId = null)
 {
     parent::__construct("Camera", $objectId, false);
     $query = new ParseQuery("Camera");
     $query->equalTo("objectId", $objectId);
     $this->_cam = $query->first();
 }
開發者ID:GerardoDRM,項目名稱:BondzuWebApp,代碼行數:7,代碼來源:Camera.php

示例10: getQuery

 public function getQuery()
 {
     $query = new ParseQuery(Constant::$CLIENT_CONTACT_INFO_CLASS_NAME);
     //        $query->equalTo(Constant::$KEY_FIRST_NAME, $firstName);
     $query->descending("createdAt");
     $results = $query->find();
     return $results;
 }
開發者ID:jokamjohn,項目名稱:Celestini_webapp,代碼行數:8,代碼來源:ClientContactInformation.php

示例11: retrieveByCredentials

 /**
  * Retrieve a user by the given credentials.
  *
  * @param  array $credentials
  *
  * @return \Illuminate\Contracts\Auth\Authenticatable|\LaraParse\Subclasses\User|null
  * @throws \Exception
  * @throws \Parse\ParseException
  */
 public function retrieveByCredentials(array $credentials)
 {
     $username = $this->getUsernameFromCredentials($credentials);
     $query = new ParseQuery('_User');
     $query->equalTo('username', $username);
     $user = $query->first(true);
     return empty($user) ? null : $user;
 }
開發者ID:khangaikh,項目名稱:golocal,代碼行數:17,代碼來源:ParseUserProvider.php

示例12: traerNoticiasSeccion

 public function traerNoticiasSeccion($seccion)
 {
     $query = new ParseQuery("noticias");
     $query->descending("fecha");
     $query->equalTo("seccion", $seccion);
     $results = $query->find();
     return $results;
 }
開發者ID:royergarci,項目名稱:ipc,代碼行數:8,代碼來源:Noticias.php

示例13: getAllRestaurantsAround

function getAllRestaurantsAround()
{
    try {
        $query = new ParseQuery("Restaurant");
        $results = $query->find();
    } catch (ParseException $ex) {
        echo $ex;
    }
    return $results;
}
開發者ID:benji031,項目名稱:finduscook,代碼行數:10,代碼來源:aleaMoment.php

示例14: 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

示例15: 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


注:本文中的Parse\ParseQuery類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。