PHP Parse.com获取指针的所有列

时间:2014-07-16 20:27:48

标签: php parse-platform

我正在使用Parse.com和PHP的库,我想在我的类RepProdMae中获取指向Product的所有列,我的代码如下,但我不知道如何查看所有列,谢谢你的帮助。

    $pqry = new parseQuery('RepProdMae') ;
    $pqry->whereInclude("Product") ;
    $pqry->wherePointer('productId','Product', 'lqf4mmpOgS') ;
    $pres = $pqry->find() ;

    print_r($pres) ;

此print_r返回:

 stdClass Object
 (
     [results] => Array
        (
        [0] => stdClass Object
            (
                [userId] => stdClass Object
                    (
                        [__type] => Pointer
                        [className] => _User
                        [objectId] => 3YjQkMwrvf
                    )

                [productId] => stdClass Object
                    (
                        [__type] => Pointer
                        [className] => Product
                        [objectId] => lqf4mmpOgS
                    )

                [comments] => nothing
                [createdAt] => 2014-07-16T01:44:41.549Z
                [updatedAt] => 2014-07-16T01:44:41.549Z
                [objectId] => 6VzG9K1BTS
            )
       )
   )

我的产品类有更多的colums,我的查询数组是:

Array
(
  [where] => {"productId":{"__type":"Pointer","className":"Product","objectId":"lqf4mmpOgS"}}
  [include] => Product
  [limit] => 100
)

1 个答案:

答案 0 :(得分:2)

Include方法的参数应该是列名,它是一个指针,而不是指向的类名。

尝试更改此行:

$pqry->whereInclude("productId") ;