PHP code example of porkchopsandwiches / doctrine-utilities
1. Go to this page and download the library: Download porkchopsandwiches/doctrine-utilities 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/ */
porkchopsandwiches / doctrine-utilities example snippets
use PorkChopSandwiches\Doctrine\Utilities\EntityManager\Generator;
$entity_manager = Generator::manufacture(
# The \Doctrine\DBAL\Connection instance or array
$database_config,
# A \Doctrine\Common\Cache instance, for Query and MetaData caching
$cache,
# A \Doctrine\Common\Annotations\AnnotationReader instance
$annotation_reader,
# An array of directories to read Entity annotations from
$entity_paths,
# The proxy autogeneration behaviour
AbstractProxyFactory::AUTOGENERATE_ALWAYS,
# Whether to ensure production settings are on
false,
# Absolute path to Doctrine/ORM/Mapping/Driver/DoctrineAnnotations.php file
ROOT_PATH . Generator::DOCTRINE_ANNOTATIONS_FILE_PATH,
# PHP namespace for proxies
"App\\Proxies",
# Absolute path to directory where proxies will be generated
ROOT_PATH . "/App/Proxies"
);