Integrating An External Orm Framework In Yii2

Hi there,

I very searched about this issue in forum and didn’t find a suitable subject for it, there was only amount content scattered. The reason that i want to start a new thread.


Is there a plan for integrate an external ORM framework like Doctrine/Propel/… in Yii2 ?


Can i know, Why shouldn’t there be such a feature? Or what’s the Yii dev team reason don’t it?

And you think existent extensions do it well?

Such a feature could be to attract a lot of users. Don’t you think so?


Yii 2 will have composer support so adding Doctrine (or other ORMs) to your project would then be a matter of adding


    "require": {

        "doctrine/orm": "*"



to your composer.json. That might be sufficient for a lot of cases

We have our own and nothing prevents you from using Doctrine with Yii.

Ok, Is better the integrating by other people be easy.

Best Regards

so, at last, dose the Yii use any ORM or integrate in it for itself?

Of course it does (see samdark’s answer above). It’s just that ONE core ORM is enough and Yii’s ActiveRecord implementation is/was one of the best parts of the framework. If you want to use something else (Doctrine, Eloquent etc.) you will have to add it on your own (with composer making this fairly straight forward I guess). You may have to use the Facade pattern though to allow a seemless integration into Yii (like configuring it through your app’s config file etc.) but this is a whole other story


in some posts that I’ve read later, the Yii ORM can’t implement the joined tables all in once.

Yii’s ORM can do very complicated queries, including aggregates. I think there was some mistake in what you’ve read.

i know.

that you said is for joins, selects etc. but what about insert and update?

please read here:

This issue has been mentioned a lot and was already confirmed. In fact on the Yii2 Roadmap on github ( it even says: