Download the PHP package huttopia/doctrine without Composer

On this page you can find all versions of the php package huttopia/doctrine. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package doctrine

version symfony symfony symfony Lines Total Downloads

huttopia/doctrine

Doctrine is a really good ORM, with nice features, we love it !

But, to be honest, no major version since 2 april 2015 (2.6 is here, but too much bugs for now), several bugs are not fixed and it takes too much time to create patch version when you create a PR to fix something.

So, we decided to create huttopia/doctrine, to fix what we need, without waiting for a release. We can add features too.

We decide to not fork Doctrine, because we want to follow Doctrine releases. Forking it now is nice and amazing, but in 2 years...

When we need to override a class, we do it with steevanb/composer-overload-class. That's a good way when you need it, without renaming namespace everywhere (we can't, that's not a fork ;)).

Changelog

Installation

Add it to your composer.json :

Register HuttopiaDoctrineBundle :

Change Doctrine configuration :

Configuration :

Doctrine bugs

Bugs who are fixed or not fixed by Doctrine, for some reasons :

For now, we fix 2.5.6 for doctrine/orm dependency : >2.5.6 and 2.6 has wrong tag (some dependencies are on dev-master, whithout version), some BC etc.

We will change it when 2.6 will be more tested.

Repositories as service

Yes, you need it too ;) Repositories as service is one of the biggest improvement.

Now, we can define your repository as service, with huttopia.repository tag :

You need to change extends Doctrine\ORM\EntityRepository by extends Huttopia\Doctrine\Orm\EntityRepository in your repositories.

Take care, our repository remove magic methods (findOneById() for example).

But it add a lot of methods :

Difference between find() and get(), and findOneBy() and getOneBy() : when entity is not found, find() will return null, as get() will throw an exception.

When you use PARTIAL, you can call createQueryBuilderWithoutSelect() instead of createQueryBuilder(), who will not select all root entity fields.

Remove useless discriminator in SQL for single table inheritance

With SINGLE_TABLE_INHERITANCE entities, Doctrine add discriminator columns into all SQL queries.

But if you want to query all entities, Doctrine add useless WHERE clause with discriminator : not really good for performances ;)

Huttopia\Doctrine\SqlWalker\IgnoreDiscriminator override Doctrine SqlWalker, to add WHERE clause only when needed.

Add it for a single query :

Add it for all queries :

#6509 Fix PersistentCollection orphanRemoval management

When you call remove(), removeElement() or clear() on PersistentCollection, and your manyToOne configuration define orphanRemoval as true, PersistentCollection will add your deleted entity in UnitOfWork::$orphanRemovals.

flush() will read UnitOfWork::$orphanRemovals, and delete all entities, although they are deleted then added.

So, if you remove an entity, then add it again, then flush(), finally, your entity will be deleted.

To fix it, we override PersistentCollection, and unschedule orphanRemovals when we add entity to PersistentCollection.

See ComposerOverloadClass installation.

Override PersistentCollection to fix it :

Enable steevanb/doctrine-events

It will replace EntityManager, to add some events : onCreateEntityOverrideLocalValues, onCreateEntityDefineFieldValues, onNewEntityInstance etc.

See Installation to install it.

Enable steevanb/doctrine-entity-merger

When you use PARTIAL in DQL, you retrieve only fields you need, instead of all Entity fields.

But, if you execute 2 PARTIAL on same entity, but not same fields, your final entity will not have second PARTIAL data, only first one is hydrated.

See Installation to install it.

Enable steevanb/doctrine-read-only-hydrator

See Benchmark, you will understand why we use ReadOnlyHydrator ;)

See Installation to install it.

Enable steevanb/doctrine-stats

steevanb/doctrine-stats add lot of statistics about queries, hydration time, lazy loaded entities, etc.

See Installation to install it.


All versions of doctrine with dependencies

PHP Build Version
Package Version
Requires php Version >=7.1.3
doctrine/orm Version 2.5.6
doctrine/doctrine-bundle Version ^1.6
doctrine/doctrine-cache-bundle Version ^1.3
steevanb/doctrine-read-only-hydrator Version ^2.2
steevanb/doctrine-entity-merger Version ^1.0
steevanb/doctrine-events Version ^1.2
steevanb/composer-overload-class Version ^1.3
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package huttopia/doctrine contains the following files

Loading the files please wait ....