click to refresh issue
[namibia] / cli-config.php
1 <?php
2 #-> Default Timezone.
3 date_default_timezone_set('Africa/Johannesburg');
4
5 #-> Entity Manager.
6 use Doctrine\ORM\Tools\Setup;
7 use Doctrine\ORM\EntityManager;
8 use Doctrine\ORM\Configuration;
9 use Doctrine\ORM\Mapping\Driver\AnnotationDriver;
10 use Doctrine\Common\Annotations\AnnotationReader;
11
12 //require_once "vendor/autoload.php";
13
14 $isDevMode = true;
15 $config = Setup::createAnnotationMetadataConfiguration(
16     array(),
17     $isDevMode
18 );
19 $baseDir = getcwd();
20 $driver = new AnnotationDriver(
21     new Doctrine\Common\Annotations\AnnotationReader(),
22     array(
23         //"$baseDir/module/Application/src/Application/Entity",
24         "$baseDir/module/Config/src/Config/Entity",
25         "$baseDir/module/Utility/src/Utility/Entity",
26         "$baseDir/module/Newsletter/src/Newsletter/Entity",
27         "$baseDir/module/Auction/src/Auction/Entity",
28         "$baseDir/module/Dispute/src/Dispute/Entity",
29         "$baseDir/module/Company/src/Company/Entity",
30         "$baseDir/module/User/src/User/Entity",
31         "$baseDir/module/Stock/src/Stock/Entity",
32         "$baseDir/module/Valuation/src/Valuation/Entity",
33         "$baseDir/module/PriceGuide/src/PriceGuide/Entity",
34         "$baseDir/module/Location/src/Location/Entity",
35         "$baseDir/module/Person/src/Person/Entity",
36         "$baseDir/module/Retail/src/Retail/Entity",
37         "$baseDir/module/Adherence/src/Adherence/Entity",
38         "$baseDir/module/Statistical/src/Statistical/Entity"
39     )
40 );
41 $config->setMetadataDriverImpl($driver);
42 $conn = array(
43     'driver'    => 'pdo_mysql',
44     'host'      => '127.0.0.1',
45     'user'      => 'root',
46     'password'  => 'nrad',
47     'dbname'    => 'nam_db'
48 );
49 $entityManager = EntityManager::create($conn, $config);
50
51 #-> Helper Set.
52 $helperSet = new \Symfony\Component\Console\Helper\HelperSet(array(
53     'em' => new \Doctrine\ORM\Tools\Console\Helper\EntityManagerHelper($entityManager)
54 ));
55 return $helperSet;