解析PHP SDK不';t返回查询结果

解析PHP SDK不';t返回查询结果,php,parse-platform,Php,Parse Platform,我能够将Parse PHP SDK(版本1.1.2)安装到我的项目中,并通过《快速入门指南》成功创建了TestObject。但是,当我试图查询对象时,它什么也不返回。我被困住了,不知道从这里到哪里去 use Parse\ParseQuery; $query = new ParseQuery('TestObject'); $results = $query->find(); foreach($results as $result){ echo $result->getObje

我能够将Parse PHP SDK(版本1.1.2)安装到我的项目中,并通过《快速入门指南》成功创建了TestObject。但是,当我试图查询对象时,它什么也不返回。我被困住了,不知道从这里到哪里去

use Parse\ParseQuery;

$query = new ParseQuery('TestObject');
$results = $query->find();
foreach($results as $result){
    echo $result->getObjectId() ." - " $result->get("foo") . "\n";
}

您可以这样尝试:

$myObj= new ParseObject("TestObject");

$myObj->set("objIdd", 1234);
$myObj->set("objName", "My Name");

try {
  $myObj->save();
  echo 'New object created with objectId: ' . $myObj->getObjectId();
} catch (ParseException $ex) { 
  // Execute any logic that should take place if the save fails.
  // error is a ParseException object with an error code and message.
  echo 'Failed to create new object, with error message: ' + $ex->getMessage();
}

//objectId: "XYZABC", objIdd: 1234, objName: "My Name"

$query = new ParseQuery("TestObject");
try {
  $myObj = $query->get("XYZABC");
  // The object was retrieved successfully.
} catch (ParseException $ex) {
  // The object was not retrieved successfully.
  // error is a ParseException with an error code and message.
}

看看这个。

不幸的是,这不起作用。我查看了ParseQuery.php文件,发现该查询实际上在工作,因为我能够在_request方法之后输出对象的json数组,但是当$obj->\u mergeAfterFetchWithSelectedKeys($row,$this->selectedKeys)时出错;你看到这个Github条目了吗?是的,我已经查看过了,但找不到哪里出了问题。相反,我决定只使用RESTAPI获取json数据,然后从那里开始。