protected function addOptionsFromResults(QueryInterface $query)
{
$items = array();
$results = $query->execute();
$type = $query->getType();
$table = strtolower(str_replace('\\', '_', $type));
$propertyName = $this->getLabelPropertyName($table, $type);
foreach ($results as $result) {
$uid = $result->getUid();
array_push($items, array(ObjectAccess::getProperty($result, $propertyName), $uid));
}
return $items;
}