Source of file ColumnHydrator.php

Size: 0,555 Bytes - Last Modified: 2023-11-16T22:56:02+01:00

/home/websites/teicee/packagist/site/phpdoc/conf/../vendor/teicee/dorm-bundle/src/Hydration/ColumnHydrator.php

12345678910111213141516171819202122232425262728
<?php
namespace TIC\DormBundle\Hydration;

use Doctrine\ORM\Internal\Hydration\AbstractHydrator;

/**
 * Récupération de toutes les valeurs de la 1ère colonne.
 *
 * Exemple:
 *   > SELECT a, b, c FROM t
 *   < array(a1, a2, a3 ...)
 */
class ColumnHydrator extends AbstractHydrator
{

	/**
	 * Hydrates all rows from the current statement instance at once.
	 *
	 * @return mixed[]
	 */
	protected function hydrateAllData(): array
	{
#		return $this->statement()->fetchAll(\PDO::FETCH_COLUMN, 0);
		return $this->statement()->fetchFirstColumn();
	}

}