Reputation: 1
this my codes
$objects = $rets->GetObject('Property','Photo','262394501','*',0);
foreach ($objects as $object)
{
$contentType=$object->GetcontentType();
$base64 = base64_encode($object->Data());
echo "<img src='data:{$contentType};base64,{$base64}' />";
}
results Fatal error: Uncaught Error: Call to undefined method PHRETS\Models\BaseObject::Data()
a var_dump of $objects
...
[19]=>
object(PHRETS\Models\BaseObject)#87 (10) {
["content_type":protected]=>
string(8) "text/xml"
["content_id":protected]=>
string(9) "262394501"
["object_id":protected]=>
string(2) "20"
["mime_version":protected]=>
NULL
["location":protected]=>
NULL
["content_description":protected]=>
NULL
["content_sub_description":protected]=>
NULL
["content":protected]=>
string(77) "<RETS ReplyCode="20409" ReplyText="Object Unavailable [262394501:20]." />
"
["preferred":protected]=>
NULL
["error":protected]=>
object(PHRETS\Models\RETSError)#96 (2) {
["code":protected]=>
int(20409)
["message":protected]=>
string(34) "Object Unavailable [262394501:20]."
}
}
and
$objects = $rets->GetObject('Property','Photo','262394501','*',1);
var_dump($objects);
....
[19]=>
object(PHRETS\Models\BaseObject)#72 (10) {
["content_type":protected]=>
string(8) "text/xml"
["content_id":protected]=>
string(9) "262394501"
["object_id":protected]=>
string(2) "20"
["mime_version":protected]=>
NULL
["location":protected]=>
string(168) "http://img-st10.paragonrels.com/ParagonImages/Property/ST10/BCRES/262394501/19/0/0/4cf9ac732b4cae04d8664c68e65e8d79/15/4f9210b40832eaa2f147bb3f3378ed49/262394501-19.JPG"
["content_description":protected]=>
NULL
["content_sub_description":protected]=>
NULL
["content":protected]=>
string(59) "<RETS ReplyCode="0" ReplyText="Operation Successful" />
"
["preferred":protected]=>
NULL
["error":protected]=>
NULL
}
}
and
$objects = $rets->GetObject('Property','Photo','262394501',1,1);
var_dump($objects);
object(Illuminate\Support\Collection)#40 (1) {
["items":protected]=>
array(1) {
[0]=>
object(PHRETS\Models\BaseObject)#33 (10) {
["content_type":protected]=>
string(8) "text/xml"
["content_id":protected]=>
string(9) "262394501"
["object_id":protected]=>
string(1) "1"
["mime_version":protected]=>
string(3) "1.0"
["location":protected]=>
string(164) "http://img-st10.paragonrels.com/ParagonImages/Property/ST10/BCRES/262394501/0/0/0/08bdc26221362780ab07cb04339d48f1/15/4f9210b40832eaa2f147bb3f3378ed49/262394501.JPG"
["content_description":protected]=>
NULL
["content_sub_description":protected]=>
NULL
["content":protected]=>
string(37) "<RETS ReplyCode="0" ReplyText="" />
"
["preferred":protected]=>
NULL
["error":protected]=>
NULL
}
}
}
there no Data array found dose it mean the account i not able to get Photo and use the L_ListingID result to fetch the photo enter image description here
Upvotes: 0
Views: 217
Reputation: 2583
Some servers don't provide images directly, so you will need to use the URL they give you:
"location":protected]=>
string(164) "http://img-st10.paragonrels.com/ParagonImages/Property/ST10/BCRES/262394501/0/0/0/08bdc26221362780ab07cb04339d48f1/15/4f9210b40832eaa2f147bb3f3378ed49/262394501.JPG"
You'll have to use that URL to get the actual image.
Upvotes: 0