This copies Config/Doctrine.php into your app namespace and cli-config.php
into the project root. Re-running the command prompts before overwriting
existing files; choose n to abort safely.
On PHP ≥ 8.4 enables the engine's native lazy objects as proxy factory (skipping proxy class generation entirely). On PHP < 8.4 the flag has no effect — Doctrine falls back to generated proxies. Set to false to keep generated proxies even on PHP 8.4+ when running tools that don't yet support native lazy objects.
Cache namespaces are automatically suffixed with the database group name for
every non-default group (e.g. doctrine_results_reporting), so multiple
groups sharing one cache backend never collide on the same keys. The default
group keeps the unsuffixed namespaces shown above.
DQL extensions registered with Doctrine. Pre-filled with beberlei/doctrineextensions and scienta/doctrine-json-functions. Override or remove entries to disable specific functions.
Native DBAL type → Doctrine type mappings registered on the database platform. Default: ['enum' => 'string', 'set' => 'string']. Re-applied automatically on Doctrine::reOpen().
Named SQL filters to register (soft-delete, multi-tenant scoping).
enabledFilters
list<string>
Names from sqlFilters to enable automatically on every EntityManager (and after reOpen()). Filter parameters must still be set at runtime via $em->getFilters()->getFilter($name)->setParameter(...).
eventListeners
array<string, list<class-string\|object>>
Doctrine event listeners keyed by event name (e.g. 'onFlush'). Class-strings are instantiated with no arguments.
Unlike the Debug Toolbar collector (which only renders under CI_DEBUG), query
logging runs in any environment, giving production a slow-query log via a PSR-3
logger (CodeIgniter's logger service by default).
Option
Type
Default
Description
queryLogging
bool
false
Enable query logging via Daycry\Doctrine\Logging\QueryLoggerMiddleware.
slowQueryThreshold
float
0.0
Minimum query duration (seconds) before logging. 0.0 logs every query (noisy); set e.g. 0.5 for slow-query logging only.
<?phpnamespaceApp\Config;useDaycry\Doctrine\Config\DoctrineasDoctrineBase;classDoctrineextendsDoctrineBase{publicbool$setAutoGenerateProxyClasses=ENVIRONMENT==='development';publicarray$entities=[APPPATH.'Models/Entity'];publicstring$proxies=APPPATH.'Models/Proxies';publicstring$proxiesNamespace='DoctrineProxies';publicbool$queryCache=true;publicbool$resultsCache=true;publicbool$metadataCache=true;publicstring$metadataConfigurationMethod='attribute';publicbool$isXsdValidationEnabled=false;// SLC: enable + collect stats (separate booleans)publicbool$secondLevelCache=true;publicbool$secondLevelCacheStatistics=true;// optional// Add a custom enum→Doctrine mapping if your DB uses enum columnspublicarray$customTypeMappings=['enum'=>'string','set'=>'string',];}
No PSR-6 adapter has to be configured for SLC — the library wires the same
backend used by Config\Cache automatically.
If a Redis or Memcached extension is missing, the Doctrine service throws
CacheException with a descriptive message at construction.
For multi-database setups (Services::doctrine(true, 'reporting')), the
same Config\Doctrine is used for every group; each group resolves its own
Doctrine instance from Config\Database->{$dbGroup}.