Ask Your Question

Revision history [back]

I was able to pull URLs using this:

// Do Login - not shown

// Get URLs for these listings

$objectIds = '123,2105156,20613399,2004701,21308298';

$objects = $rets->GetObject('Property', 'Photo', $objectIds, '*', 1);

$objectCount = 0;
$objectFailedCount = 0;

foreach ($objects as $object) {
// Does this represent some kind of error
if ($object->isError())
{
$objectFailedCount++;
$errorInfo = $object->getError();
//var_dump($errorInfo);
echo "\ncode: " . $errorInfo->getCode();
echo "\nmessage: " . $errorInfo->getMessage();
echo "\ngetContentId: " . $object->getContentId();
echo "\ngetObjectId: " . $object->getObjectId();
echo "\ngetContentType: " . $object->getContentType();
echo "\ngetContent: \n" . $object->getContent();
echo "\n\n";
continue;
}

$objectCount++;

// get the record ID associated with this object
echo "\ngetContentId: " . $object->getContentId();

// get the sequence number of this object relative to the others with the same ContentId
echo "\ngetObjectId: " . $object->getObjectId();

// get the description of the object
echo "\ngetContentDescription: " . $object->getContentDescription();

// get the sub-description of the object
echo "\ngetContentSubDescription: " . $object->getContentSubDescription();

// get the size of the object"s data
echo "\ngetSize: " . $object->getSize();

// does this object represent the primary object in the set
echo "\nisPreferred: " . $object->isPreferred();

// when requesting URLs, access the URL given back
echo "\ngetLocation: \n" . $object->getLocation();

// get the object"s Content-Type value
echo "\ngetContentType: " . $object->getContentType();

// get the object"s binary data
echo "\ngetContent: \n" . $object->getContent();

// use the given URL and make it look like the RETS server gave the object directly
// $object->setContent(file_get_contents('http:' . $object->getLocation()));
// echo "\nDownloaded-getSize: " . $object->getSize();

echo "\n\n";
}

echo "Object Count: $objectCount\n";
echo "Object Failed Count: $objectFailedCount\n";
echo "\n\n";


// Logout of session when finished
$rets->Disconnect()

I was able to pull URLs using this:

// Do Login - not shown

// Get URLs for these listings

$objectIds = '123,2105156,20613399,2004701,21308298';'123,129709,130201,132738,132908,132953';

$objects = $rets->GetObject('Property', 'Photo', $objectIds, '*', 1);

$objectCount = 0;
$objectFailedCount = 0;

foreach ($objects as $object) {
// Does this represent some kind of error
if ($object->isError())
{
$objectFailedCount++;
$errorInfo = $object->getError();
//var_dump($errorInfo);
echo "\ncode: " . $errorInfo->getCode();
echo "\nmessage: " . $errorInfo->getMessage();
echo "\ngetContentId: " . $object->getContentId();
echo "\ngetObjectId: " . $object->getObjectId();
echo "\ngetContentType: " . $object->getContentType();
echo "\ngetContent: \n" . $object->getContent();
echo "\n\n";
continue;
}

$objectCount++;

// get the record ID associated with this object
echo "\ngetContentId: " . $object->getContentId();

// get the sequence number of this object relative to the others with the same ContentId
echo "\ngetObjectId: " . $object->getObjectId();

// get the description of the object
echo "\ngetContentDescription: " . $object->getContentDescription();

// get the sub-description of the object
echo "\ngetContentSubDescription: " . $object->getContentSubDescription();

// get the size of the object"s data
echo "\ngetSize: " . $object->getSize();

// does this object represent the primary object in the set
echo "\nisPreferred: " . $object->isPreferred();

// when requesting URLs, access the URL given back
echo "\ngetLocation: \n" . $object->getLocation();

// get the object"s Content-Type value
echo "\ngetContentType: " . $object->getContentType();

// get the object"s binary data
echo "\ngetContent: \n" . $object->getContent();

// use the given URL and make it look like the RETS server gave the object directly
// $object->setContent(file_get_contents('http:' . $object->getLocation()));
// echo "\nDownloaded-getSize: " . $object->getSize();

echo "\n\n";
}

echo "Object Count: $objectCount\n";
echo "Object Failed Count: $objectFailedCount\n";
echo "\n\n";


// Logout of session when finished
$rets->Disconnect()