. */ namespace Doctrine\ORM\Internal\Hydration; use Doctrine\DBAL\Connection; /** * Description of SingleScalarHydrator * * @author Roman Borschel */ class SingleScalarHydrator extends AbstractHydrator { /** @override */ protected function _hydrateAll() { $cache = array(); $result = $this->_stmt->fetchAll(Connection::FETCH_ASSOC); //TODO: Let this exception be raised by Query as QueryException if (count($result) > 1 || count($result[key($result)]) > 1) { throw HydrationException::nonUniqueResult(); } $result = $this->_gatherScalarRowData($result[key($result)], $cache); return array_shift($result); } /** {@inheritdoc} */ protected function _getRowContainer() { return array(); } }