. */ /** * Compiler pass which triggers Symgony to tell Doctrine to * use out `SchemaDef` metadata driver * * @package GNUsocial * @category DB * * @author Hugo Sales * @copyright 2020 Free Software Foundation, Inc http://www.fsf.org * @license https://www.gnu.org/licenses/agpl.html GNU AGPL v3 or later */ namespace App\DependencyInjection\Compiler; use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Reference; /** * Register a new ORM driver to allow use to use the old schemaDef format */ class SchemaDefPass implements CompilerPassInterface { public function process(ContainerBuilder $container) { $container->findDefinition('doctrine.orm.default_metadata_driver') ->addMethodCall('addDriver', [new Reference('app.util.schemadef_driver'), 'App\\Entity'] ); } }