首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Phrets使用getobject给出了无效的类型错误

Phrets使用getobject给出了无效的类型错误
EN

Stack Overflow用户
提问于 2017-12-04 14:54:11
回答 2查看 273关注 0票数 1

有谁能帮助我如何使用reso phrets获取属性的图像?

下面是正在执行的代码:

代码语言:javascript
复制
$rets   = new \PHRETS\Session($config);
$search = $rets->Search("Property","Residential","*",
    array( 
        'QueryType'           => 'DMQL2',
        "Count"               => 1,
        "Format"              => "COMPACT-DECODED",
        "Limit"               => 5,
        "Offset"              => 0,
        "Select"              => "ListingKeyNumeric,BuyerAgentLastName,buyerAgentFirstName,buyerOfficeName,City,Country,CurrentPrice,StreetName,PostalCode,StateOrProvince,StreetNumberNumeric,BedroomsTotal,BathroomsTotalInteger,LotSizeSquareFeet,YearBuilt,StandardStatus,LotSizeAcres,ListOfficeMlsId,ListPrice,BathroomsFull,BathroomsHalf,PropertySubType,ArchitecturalStyle,MLSAreaMajor,CountyOrParish,Utilities,ParkingTotal,ParkingFeatures,GarageSpaces,View,PoolPrivateYN,PoolFeatures,InteriorFeatures,Appliances,Heating,Cooling,FireplaceYN,FireplaceFeatures,StoriesTotal,ExteriorFeatures,LotSizeDimensions,WindowFeatures,Roof,ConstructionMaterials,FoundationDetails,HighSchoolDistrict,ElementarySchool,MiddleOrJuniorSchool,OriginalEntryTimestamp,DaysOnMarket,Zoning,AssociationFee,AssociationFeeFrequency,ListOfficeName,PricePerSquareFoot,ListAgentFirstName,ListAgentLastName,ListAgentMlsId,InternetAddressDisplayYN,ListingId,PhotosCount",
        "RestrictedIndicator" => "****",
        "StandardNames"       => 1 
    )
);

foreach ($search as $r) {

    $rets_resource = 'Property';
    $object_type   = 'photo';
    $listing_id    = $r['ListingId'];
    $photos        = $rets->GetObject('Property',$classes->first()->getClassName(),'OC17206923,217009806DA,PW17081942','*',0);
    print_r($photos);
}

结果我得到了什么:

代码语言:javascript
复制
Illuminate\Support\Collection Object
(    [items:protected] => Array
    (
      [0] => PHRETS\Models\Object Object
      (
       [content_type:protected] => text/xml
       [content_id:protected] => 
       [object_id:protected] => 
       [mime_version:protected] => 1.0
       [location:protected] => 
       [content_description:protected] => 
       [content_sub_description:protected] => 
       [content:protected] => 

       [preferred:protected] => 
       [error:protected] => PHRETS\Models\RETSError Object
      (
        [code:protected] => 20401
        [message:protected] => Invalid Type
      )
    )
  )
)
EN

回答 2

Stack Overflow用户

发布于 2017-12-05 16:07:10

$classes->first()->getClassName() ()调用中类型参数的值是多少?

也许你想用“照片”或者$object_type来代替?

票数 0
EN

Stack Overflow用户

发布于 2017-12-19 10:28:47

提供给getObject()方法的第二个param是错误的。您正在尝试提供类名,而不是对象类型。

请查看此getObject()文档以供参考。

需要像这样改变你的代码

代码语言:javascript
复制
$photos        = $rets->GetObject('Property',$object_type,'OC17206923,217009806DA,PW17081942','*',0);

此外,您还可以更改最后一个参数"1“,以获得图像url单独。这个选项可能不是所有MLSs都支持的。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/47636042

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档