public function getValue($columnName)
{
if (false === strpos($columnName, '.')) {
$columnName = $this->defaultSelectorName . '.' . $columnName;
}
$values = $this->getValues();
if (!array_key_exists($columnName, $values)) {
throw new ItemNotFoundException("Column '{$columnName}' not found");
}
$value = $values[$columnName];
// According to JSR-283 6.7.39 a query should only return
// single-valued properties. We join the values when it's a string
// for multi-values boolean/binary values we can't provide a
// defined result so we return null
if (is_array($value)) {
if (is_scalar($value[0]) && !is_bool($value[0])) {
$value = implode(' ', $value);
} else {
$value = null;
}
}
return $value;
}