Source of file DoctrineCompilerPass.php

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

/home/websites/teicee/packagist/site/phpdoc/conf/../vendor/teicee/dorm-bundle/src/DependencyInjection/DoctrineCompilerPass.php

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
<?php
namespace TIC\DormBundle\DependencyInjection;

use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;

/**
 * Chargement des configurations et initialisation du bundle.
 * @link http://symfony.com/doc/current/bundles/extension.html
 */
class DoctrineCompilerPass implements CompilerPassInterface
{

	/**
	 * You can modify the container here before it is dumped to PHP code.
	 *
	 * @param ContainerBuilder $container
	 */
	public function process(ContainerBuilder $container): void
	{
		$ormConfigDef = $container->getDefinition('doctrine.orm.configuration');
		
		$ormConfigDef->addMethodCall('addCustomHydrationMode',
			['column',  'TIC\DormBundle\Hydration\ColumnHydrator']
		);
		$ormConfigDef->addMethodCall('addCustomHydrationMode',
			['exists',  'TIC\DormBundle\Hydration\ExistsHydrator']
		);
		$ormConfigDef->addMethodCall('addCustomHydrationMode',
			['extras',  'TIC\DormBundle\Hydration\ExtrasHydrator']
		);
		$ormConfigDef->addMethodCall('addCustomHydrationMode',
			['keyval',  'TIC\DormBundle\Hydration\KeyvalHydrator']
		);
		$ormConfigDef->addMethodCall('addCustomHydrationMode',
			['keylist', 'TIC\DormBundle\Hydration\KeylistHydrator']
		);
		$ormConfigDef->addMethodCall('addCustomHydrationMode',
			['keyhash', 'TIC\DormBundle\Hydration\KeyhashHydrator']
		);
		$ormConfigDef->addMethodCall('addCustomHydrationMode',
			['groupby', 'TIC\DormBundle\Hydration\GroupbyHydrator']
		);
	}

}