PHP code example of sergiors / doctrine-orm-service-provider
1. Go to this page and download the library: Download sergiors/doctrine-orm-service-provider library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
sergiors / doctrine-orm-service-provider example snippets
use Silex\Provider\DoctrineServiceProvider;
use Sergiors\Pimple\Provider\DoctrineOrmServiceProvider;
use Sergiors\Pimple\Provider\DoctrineCacheServiceProvider;
$app->register(new DoctrineServiceProvider(), [
// your db config
]);
$app->register(new DoctrineCacheServiceProvider());
$app->register(new DoctrineOrmServiceProvider(), [
'orm.proxy_dir' => '',
'orm.proxy_namespace' => ''
]);
$app['orm']->getRepository('Namespace\Entity\User')->findAll();