当前位置: 首页>>代码示例>>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;未经允许,请勿转载。