2017-12-04 1 views
1

하나는 reso phrets를 사용하여 재산 이미지를 얻는 방법을 알려줍니다. 내가 무엇입니까 무엇Phrets가 getobject를 사용하여 잘못된 유형 오류를 표시했습니다.

$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); 
} 

결과 : 아래

이 실행되는 내 코드입니다

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 
    ) 
    ) 
) 
) 

답변

0

$ 클래스 ->의 값이 무엇을 첫 번째() -> 경우, getClassName () getObject() 호출의 type 매개 변수는 무엇입니까?

대신 '사진'또는 $ object_type을 사용 하시겠습니까?

0

getObject() 메소드에 지정된 두 번째 매개 변수가 잘못되었습니다. 클래스 이름 대신 객체 유형을 지정하려고합니다.

참고로이 설명서를 getObject() 설명서를 확인하십시오.

필요는

$photos  = $rets->GetObject('Property',$object_type,'OC17206923,217009806DA,PW17081942','*',0); 

또한 당신은 혼자가 이미지 URL을 얻기 위해 "1"로 마지막 PARAM을 변경할 수 있습니다, 다음과 같이 코드를 변경합니다. 이 옵션은 모든 MLS에서 지원하지 않을 수 있습니다.

관련 문제