Skip to content

brenodouglas/doctrineconfig

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Doctrine configuration for Respect/Rest

Integration doctrine in project Respect/Rest

Require PHP >= 5.3

In index.php

  require 'autoload.php';
  
  \RespectDoctrine\Doctrine\Doctrine::setConfigDir("config.php");
  $doctrine = new Doctrine();
  $em = $doctrine->getEntityManager();

In config.php

return [
  'database' => [
      
      'default' => 'mysql',
      
      'mysql' => [
          'dbname' => "application",
          'user' => 'root',
          'port' => null,
          'password' => '',
          'host' => 'localhost',
          'driver' => 'pdo_mysql'
      ],

      'pgsql' => [
          'dbname' => "application",
          'user' => 'root',
          'port' => 5232,
          'password' => '',
          'host' => 'localhost',
          'driver' => 'pdo_pgsql'
      ]

  ],

  'doctrine' => [
      /** Namespaces on Entity mapped */
      'entity' => [
          __DIR__."/Api/Entity"
      ],
      /** Dir of metadatas generate */
      'metadata' => __DIR__."/../cache/doctrine"
  ]
];

About

Utils config for doctrine

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages