<?php



        namespace Template\Infra;



        use Doctrine\ORM\EntityManager;

        use Doctrine\ORM\EntityManagerInterface;

        use Doctrine\ORM\Tools\Setup;



        class EntityManagerCreator

        {

            public function getEntityManager(): EntityManagerInterface

            {

                $paths = [__DIR__ . "/../Entity"];

                $isDevMode = false;



                $dbParams = [

                    "driver"   => "pdo_mysql",

                    "user"     => "wwwodontocampina_Kimpages1",

                    "password" => "marketingA321",

                    "dbname"   => "wwwodontocampina_Kimpages1",

                    "charset"  => "UTF8", 		

                    "driverOptions"	=> array("1002"=> "SET NAMES UTF8 COLLATE utf8_general_ci"),

                ];



                $config = Setup::createAnnotationMetadataConfiguration(

                    $paths,

                    $isDevMode

                );

                return EntityManager::create($dbParams, $config);

            }

        }

        