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


PHP ParseQuery::find方法代码示例

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


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

示例1: alerts

 public function alerts($cc = null)
 {
     $current_user = ParseUser::getCurrentUser();
     $query = new ParseQuery("Notifications");
     $query->equalTo("for", $current_user);
     $query->equalTo("read", false);
     $query->includeKey('by');
     $query->includeKey('message');
     try {
         $notifications = $query->find();
         $notes = array();
         foreach ($notifications as $notify) {
             if (!empty($notify->get('message'))) {
                 if ($notify->get('message')->get('chatRoom')->getObjectId() == $cc) {
                     $notify->set("read", true);
                     $notify->save();
                     continue;
                 }
                 $notes[] = ['id' => $notify->getObjectId(), 'for' => $notify->get('for')->getObjectId(), 'from' => ['id' => $notify->get('by')->getObjectId(), 'name' => $notify->get('by')->get('name')], 'message' => $notify->get('message')->get('message')];
             }
         }
         $ret = ['status' => "success", 'data' => ['notifications' => $notes]];
         return response()->json($ret);
     } catch (ParseException $ex) {
         $ret = ['status' => 'fail', 'error' => $ex->getMessage()];
         return response()->json($ret);
     }
 }
开发者ID:samphomsopha,项目名称:codelab,代码行数:28,代码来源:NotificationServiceController.php

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

示例3: get

 /**
  * Executes the query and returns its results.
  *
  * @param string|string[] $selectKeys
  *
  * @return Collection
  */
 public function get($selectKeys = null)
 {
     if ($selectKeys) {
         $this->select($selectKeys);
     }
     return $this->createModels($this->parseQuery->find($this->useMasterKey));
 }
开发者ID:parziphal,项目名称:parse,代码行数:14,代码来源:Query.php

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

示例5: process

 /**
  * @inheritdoc
  */
 public function process(array $settings = [])
 {
     $this->processOrders($settings);
     $this->processFilters($settings);
     $this->source->limit($settings['limit']);
     $this->source->skip(($settings['page'] - 1) * $settings['limit']);
     // run queries
     $gridData = new Grid\Data($this->source->find());
     // get all records to set grid total
     // @todo: cache result of total query for few minutes
     $this->source = new ParseQuery($this->collectionName);
     $this->processOrders($settings);
     $this->processFilters($settings);
     $gridData->setTotal(sizeof($this->source->limit(1000)->find()));
     return $gridData;
 }
开发者ID:bashmach,项目名称:bluz-skeleton-parse,代码行数:19,代码来源:ParseSource.php

示例6: create

 public function create(array $params = [])
 {
     $query = new ParseQuery("Brand");
     $results = $query->find();
     @($this->viewData->brands = $results);
     @$this->loadView($this->viewData);
 }
开发者ID:xxxtj,项目名称:code,代码行数:7,代码来源:brand_postController.php

示例7: getSleepers

function getSleepers()
{
    $query = new ParseQuery("BagTransaction");
    $query->equalTo("status", "active");
    $results = $query->find();
    return $results;
}
开发者ID:justingil1748,项目名称:HackBag,代码行数:7,代码来源:funcs.php

示例8: getSeekers

function getSeekers()
{
    $query = new ParseQuery("_User");
    $query->equalTo("seeking", true);
    $results = $query->find();
    return $results;
}
开发者ID:justingil1748,项目名称:HackBag,代码行数:7,代码来源:funcs.php

示例9: indexAction

 /**
  * App index simply grabs all the user's items and returns them. The template will render the list.
  *
  * @return array
  */
 public function indexAction()
 {
     $query = new ParseQuery(self::PARSE_CLASS);
     $query->equalTo('user', $this->user);
     $items = $query->find();
     return ['items' => $items];
 }
开发者ID:mkhuramj,项目名称:ToDo-Web,代码行数:12,代码来源:AppController.php

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

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

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

 /**
  * Returns all objects where a given field matches a given value
  * @param string $field
  * @param mixed $value
  * @param array $keyToInclude
  *
  * @return Collection|ParseObject[]
  */
 public function findAllBy($field, $value, $keyToInclude = [])
 {
     $this->query->equalTo($field, $value);
     for ($i = 0; $i < count($keyToInclude); $i++) {
         $this->query->includeKey($keyToInclude[$i]);
     }
     return Collection::make($this->query->find($this->useMasterKey));
 }
开发者ID:khangaikh,项目名称:golocal,代码行数:16,代码来源:AbstractParseRepository.php

示例14: indexAction

 /**
  * Lists all ProjectsAdmin entities.
  *
  * @Route("/index/{page}", name="admin_projects", defaults={ "page" = 1 })
  * @Method("GET")
  * @Template()
  */
 public function indexAction($page)
 {
     $query = new ParseQuery('Project');
     $query->ascending("label");
     $query->limit(12);
     $query->skip(12 * ($page - 1));
     $entities = $query->find();
     return array('entities' => $entities, 'hits' => ceil($query->count() / 12), 'page' => $page, 'csrf' => $this->get('form.csrf_provider'));
 }
开发者ID:leonardobarrientosc,项目名称:4046-PUCV-ICC-FICHAS-OBRAS-CIVILES,代码行数:16,代码来源:ProjectsAdminController.php

示例15: index

 public function index()
 {
     $query = new ParseQuery("attractions");
     try {
         $attractions = $query->find();
         return view('expertTemplate.displayAttractions')->with('attractions', $attractions);
     } catch (ParseException $ex) {
     }
 }
开发者ID:aktn,项目名称:Laravel_TripPlan,代码行数:9,代码来源:ExpertController.php


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