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


PHP ParseQuery::equalTo方法代碼示例

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


在下文中一共展示了ParseQuery::equalTo方法的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: 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

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

示例4: view

 public function view()
 {
     $query = new ParseQuery('CarWashPackages');
     $query->equalTo("isRemoved", false);
     $results["packages"] = $query->find();
     return $results;
 }
開發者ID:oscarsmartwave,項目名稱:l45fbl45t,代碼行數:7,代碼來源:Packages_model.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: processFilters

 /**
  * Apply filter settings to the source
  *
  * @param array $settings
  */
 protected function processFilters(array $settings = [])
 {
     foreach ($settings['filters'] as $column => $filter) {
         switch (key($filter)) {
             case Grid\Grid::FILTER_EQ:
                 $this->source->equalTo($column, reset($filter));
                 break;
             case Grid\Grid::FILTER_LIKE:
                 $this->source->startsWith($column, reset($filter));
                 break;
             default:
                 // throw NotImplemented?
                 break;
         }
     }
 }
開發者ID:bashmach,項目名稱:bluz-skeleton-parse,代碼行數:21,代碼來源:ParseSource.php

示例7: auth

 /**
  * Handles authentication via estonian id-card. Saves data into model User.
  */
 public function auth()
 {
     $ePerson = getEPerson();
     if (!$ePerson) {
         //             TODO: Better handling
         $this->user->string = "ID kaardiga autentimine ebaõnnestus!";
     } else {
         $this->user->lastName = $ePerson[0];
         $this->user->firstName = $ePerson[1];
         $this->user->nationalID = $ePerson[2];
         $this->user->string = "ID kaardiga autentimine õnnestus edukalt!";
         // Check if UserObject already exists
         // TODO: Put following code into separate function
         $query = new ParseQuery("UserObject");
         $query->equalTo("nationalID", $this->user->nationalID);
         $count = $query->count();
         $parseUser = $query->first();
         if ($count == 1 && $parseUser->get('nationalID') == $this->user->nationalID) {
             $this->user->parseMessage = $parseUser->getObjectId();
         } else {
             $this->saveUserData($this->user, $this->user->lastName, $this->user->firstName, $this->user->nationalID);
         }
         // Starts user session
         $this->begin_session();
         //            $this->signUp($this->user, $this->user->lastName, $this->user->firstName, $this->user->nationalID);
     }
 }
開發者ID:aglo35,項目名稱:vr_beta,代碼行數:30,代碼來源:Controller.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: 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: __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

示例11: getSeekers

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

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

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

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

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


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