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


PHP ParseQuery::select方法代码示例

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


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

示例1: first

 /**
  * Get the first record that matches the query.
  *
  * @param mixed $selectKeys
  *
  * @return ObjectModel|null
  */
 public function first($selectKeys = null)
 {
     if ($selectKeys) {
         $this->parseQuery->select($selectKeys);
     }
     $data = $this->parseQuery->first($this->useMasterKey);
     if ($data) {
         return $this->createModel($data);
     }
 }
开发者ID:parziphal,项目名称:parse,代码行数:17,代码来源:Query.php

示例2: tasks

 public function tasks()
 {
     $results = array();
     $object = array();
     $queryCrop = new ParseQuery("Crop");
     $queryCrop->select("cropName");
     $queryCrop->ascending("cropName");
     $object = $queryCrop->find();
     foreach ($object as $value) {
         array_push($results, $value->get('cropName'));
     }
     return view('tasks')->with("results", $results);
 }
开发者ID:whizdummy,项目名称:Farmers-Plaza-Web,代码行数:13,代码来源:TasksController.php

示例3: maintenance

 public function maintenance()
 {
     $results = array();
     $queryCropType = new ParseQuery("CropType");
     $queryCropType->select("cropTypeDesc");
     $queryCropType->ascending("cropTypeDesc");
     $cropType = $queryCropType->find();
     $results[0] = array();
     //QUERY ALL CROP TYPE PARSE OBJECTS
     foreach ($cropType as $cType) {
         array_push($results[0], $cType->get('cropTypeDesc'));
     }
     $queryFertilizer = new ParseQuery("Fertilizer");
     $fertilizer = $queryFertilizer->find();
     $results[1] = array();
     //QUERY ALL FERTILIZER TYPE PARSE OBJECTS
     foreach ($fertilizer as $fert) {
         array_push($results[1], $fert->get('fertilizerDesc'));
     }
     return view('maintenance')->with("results", $results);
 }
开发者ID:whizdummy,项目名称:Farmers-Plaza-Web,代码行数:21,代码来源:PageController.php

示例4: testSelectKeysQueryArrayArg

 public function testSelectKeysQueryArrayArg()
 {
     $obj = ParseObject::create("TestObject");
     $obj->set('foo', 'baz');
     $obj->set('bar', 1);
     $obj->save();
     $query = new ParseQuery("TestObject");
     $query->select(['foo', 'bar']);
     $result = $query->first();
     $this->assertEquals('baz', $result->get('foo'), 'Did not return the correct object.');
     $this->assertEquals(1, $result->get('bar'), 'Did not return the correct object.');
 }
开发者ID:rvdavid,项目名称:parse-php-sdk,代码行数:12,代码来源:ParseQueryTest.php

示例5: getTimeZone

 public function getTimeZone()
 {
     // ParseInstallation.getCurrentInstallation().getString("_Installation");
     $query = new ParseQuery('_Installation', true);
     try {
         $query->select("timeZone");
         $results = $query->find(true);
         $array = array();
         foreach ($results as $result) {
             $array[] = $result->get("timeZone");
         }
         // die('<pre>'.print_r(array_unique($array)));
         return array_unique($array);
     } catch (ParseException $ex) {
         $ex_array = array("Status" => "FAILED", "Message" => $ex->getMessage(), "Code" => $ex->getCode());
         return $ex_array;
     }
     return $results;
 }
开发者ID:oscarsmartwave,项目名称:l45fbl45t,代码行数:19,代码来源:Notifications_model.php


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