is there any non time intensive way to use the active record component from Yii2 “standalone”? I would need only the active record component along with Gii in a project. The symfony framework allows to use it’s components de-coupled. Is Yii2 able for this, too?
Thanks for the answer. The article advices to boot the entire framework. That "can" be a way. Hopefully at least bower etc. can be de-coupled if no frontend is needed. Does anybody know how to boot only the component?
Hi, The answer is no, as long as you couldnt use it’s components without using Yii::$app (or Yii::app() for Yii1.1) Yii is tightly coupled even it’s Dependency injection container is coupled to the Yii class Yii::$container
That’s pitty. Because the Active Record component is much more powerful than Doctrine, which can be used de-coupled. But Doctrine does not have eager and lazy loading along with translated joins into more performant select queries.
Yii2 active record is realy powerful but is just a tool, Doctrine implements Data Mapper patern, so choosing Doctrine or Active Record depends on your Application design more then tools features, you should digg deeper in Doctrine to find how it can perfom eager loading if you realy need decoupled Active Record implementation without the whole framework you may look at Propel or similar implementation