protected function setObjectProperty($source, $properties, &$collections)
{
$hash = $this->getObjectHash($source, $properties);
$prop = $this->getContext()->getProperty();
if (isset($collections[$hash]) && count($collections[$hash]) > 0) {
if (count($collections[$hash]) > 1) {
throw new TActiveRecordException('ar_belongs_to_multiple_result');
}
$source->{$prop} = $collections[$hash][0];
} else {
$source->{$prop} = null;
}
}