2017-12-04 4 views
1

kann mir helfen, wie man Bilder von Eigentum mit Reso Phrets bekommen.Phrets gibt einen ungültigen Typ Fehler mit getobject

Unten ist mein Code, der ausgeführt wird:

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

Ergebnis Was ich erhalte:

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

Antwort

0

Was ist der Wert von $ classes-> first() ist -> getClassName () für den Typ Parameter in der getObject() -Aufruf?

Vielleicht möchten Sie stattdessen 'photo' oder $ object_type verwenden?

0

Der zweite Parameter der Methode getObject() ist falsch. Sie versuchen, den Klassennamen anstelle des Objekttyps anzugeben.

Überprüfen Sie diese Phrets getObject() Dokumentation als Referenz.

Need Code wie folgt ändern,

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

auch mit "1" können Sie die letzte param ändern allein die Bild-URL zu erhalten. Diese Option wird möglicherweise nicht von allen MLSs unterstützt.

Verwandte Themen