Doctrine 2 Object Relational Mapper (ORM)
As previously reported by @flaushi in https://github.com/doctrine/doctrine2/pull/7471#discussion_r241949045, we discovered that binding a parameter causes a `ClassMetadataFactory#getClassMetadata()` call, which in turn leads to large performance regression when using any `object` type as parameter. Following two snippets lead to an internal `ClassMetadataFactory#getClassMetadata()` call, which in turn leads to an exception being thrown and garbage collected, plus multiple associated performance implications: ```php $query->setParameter('foo', new DateTime()); $query->getResult(); ``` ```php $query->setParameter('foo', new DateTime(), DateTimeType::NAME); $query->getResult(); ``` This is due to following portion of code: |
||
---|---|---|
bin | ||
docs | ||
lib/Doctrine/ORM | ||
tests | ||
tools/sandbox | ||
.gitattributes | ||
.gitignore | ||
.gitmodules | ||
.scrutinizer.yml | ||
.travis.yml | ||
build.properties | ||
build.properties.dev | ||
build.xml | ||
composer.json | ||
composer.lock | ||
CONTRIBUTING.md | ||
doctrine-mapping.xsd | ||
LICENSE | ||
phpbench.json | ||
phpcs.xml.dist | ||
phpstan.neon | ||
phpunit.xml.dist | ||
README.md | ||
run-all.sh | ||
SECURITY.md | ||
UPGRADE.md |
Master | 2.5 |
---|---|
Doctrine 2 is an object-relational mapper (ORM) for PHP 7.1+ that provides transparent persistence for PHP objects. It sits on top of a powerful database abstraction layer (DBAL). One of its key features is the option to write database queries in a proprietary object oriented SQL dialect called Doctrine Query Language (DQL), inspired by Hibernate's HQL. This provides developers with a powerful alternative to SQL that maintains flexibility without requiring unnecessary code duplication.