<?php
// bootstrap.php
require_once __DIR__ . "/vendor/autoload.php";

use Doctrine\ORM\Tools\Setup;
use Doctrine\ORM\EntityManager;

use Syslogic\DoctrineJsonFunctions\Query\AST\Functions\Mysql as DqlFunctions;

// $paths = array(__DIR__."/src/models", __DIR__."/src/services");
$paths = array(__DIR__."/src/models");  // models and services should be kept in separate folders 
$isDevMode = true;     // if 'false' I need to keep creating proxy folder every time re starting the computer 
                        // this may require a work around 

// the connection configuration
$dbParams = array(
   'driver'   => 'pdo_mysql',
    'user'     => 'prag_corexx',
    'password' => 'Chandan.khalepara8721',
    'dbname'   => 'prag_main',
    'charset' => 'utf8'
);

$config = Setup::createAnnotationMetadataConfiguration($paths, $isDevMode);
// or if you prefer yaml or annotations
//$config = Setup::createXMLMetadataConfiguration(array(__DIR__."/orm-config/xml"), $isDevMode);
//$config = Setup::createYAMLMetadataConfiguration(array(__DIR__."/orm-config/yaml"), $isDevMode);

$entityManager = EntityManager::create($dbParams, $config);


/* 
IMPORTANT COMMONDS:

To generate proxies in production mode: 
$ vendor/bin/doctrine orm:generate-proxies

Others: 
$ vendor/bin/doctrine orm:schema-tool:create

$ vendor/bin/doctrine orm:schema-tool:drop --force
$ vendor/bin/doctrine orm:schema-tool:create

$ vendor/bin/doctrine orm:schema-tool:update --force
$ vendor/doctrine/orm/bin/doctrine.php orm:schema-tool:update --force
$ vendor/doctrine/orm/bin/doctrine.php orm:generate:entities ./src/models
$ http: //192.168.43.229/demo-college/api/public

*/

