2009-11-06 23 views
0

我使用PHREST類從RETS服務器獲取照片我可以獲取其城市,州,郵編和價格,但我無法獲取屬性圖像我使用下面的函數無法在使用PHRETS類的RETS(房地產交易系統)中獲取照片

 
$photos = $rets->GetObject("Property","Photo","05-020123:CLAW",1); 
print_r($photos);

我在這裏通過「05-020123:爪」這是UniqueID的是我從搜索查詢得到上市,我得到了以下結果:

 
Array 
(
    [0] => Array 
     (
      [Success] => 
      [Content-Type] => text/xml 
      [MIME-Version] => 1.0 

      [Length] => 185 
      [Data] => 


      [ReplyCode] => 20402 
      [ReplyText] => V2.5.0 640: The identifier does not match the KeyField of any data in the resource. Reason: An resource-entity must only contain digits. 
     ) 

) 

請幫助我出去了。

回答

2

GetObject()的第三個參數需要簡單地是一個ID。

如果您訪問www.retsmd.com並使用您的登錄信息,您將能夠確定您要查找的特定RETS類的KeyField。一旦您知道要查看的字段,請從屬性數據中提取該字段的其中一個值並將其置於適當的位置。

因此,如果KeyField是「ListingNumber」,那麼您可能會發現1234567作爲記錄的ListingNumber值。

$photos = $rets->GetObject("Property", "Photo", "1234567"); 
foreach ($photos as $photo) { 
    print_r($photo); 
} 

這應該吐出一些二進制圖像數據給你。查看http://troda.com/projects/phrets/index.php?title=GetObject上的樣本以獲取更多提示。

0

我想照片下載之前,建議使用PHRETS請找無論是照片

$ rets-> GetObject的()和剛剛的var_dump(MLS IDX支持第三方網址),並檢查是否支持第三方URL沒有必要下載照片

如果第三方URL支持,那麼你需要獲取照片的get_curl linux命令。