. */ namespace Doctrine\ORM\Internal\Hydration; use Doctrine\DBAL\Connection; /** * Hydrator that produces flat, rectangular results of scalar data. * The created result is almost the same as a regular SQL result set, except * that column names are mapped to field names and data type conversions take place. * * @since 2.0 * @author Roman Borschel * @author Guilherme Blanco */ class ScalarHydrator extends AbstractHydrator { /** * {@inheritdoc} */ protected function hydrateAllData() { $result = array(); $cache = array(); while ($data = $this->_stmt->fetch(\PDO::FETCH_ASSOC)) { $this->hydrateRowData($data, $cache, $result); } return $result; } /** * {@inheritdoc} */ protected function hydrateRowData(array $data, array &$cache, array &$result) { $result[] = $this->gatherScalarRowData($data, $cache); } }