/**
* Determine what attributes should be selected. This accounts for a query wanting all attributes.
*
* @param array $selected
* @param array $entry
* @return array
*/
protected function getSelectedAttributes(array $selected, array $entry)
{
if (count($selected) === 1 && $selected[0] == '*' && !$this->schema) {
$selected = array_keys($entry);
} elseif (count($selected) === 1 && $selected[0] == '*' && $this->schema) {
$selected = array_unique(array_merge(array_keys($this->schema->getAttributeMap()), array_keys($entry)));
}
return $selected;
}