本文整理汇总了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);
}
}
示例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);
}
示例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);
}
示例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.');
}
示例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;
}