New CakePHP ORM to CakePHP 2.x

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

New CakePHP ORM to CakePHP 2.x

Sulian Lanteri
Hello

Before migrate a big application in CakePHP3, I want first use the new ORM in this CakePHP 2.6 application, any idea how to do that (and/or a good example) ?

Sulian

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: New CakePHP ORM to CakePHP 2.x

José Lorenzo
It depends. The ORM can be installed as a standalone library already, what kind of integration are you looking after?

On Tuesday, September 22, 2015 at 9:23:50 AM UTC+2, Sulian Lanteri wrote:
Hello

Before migrate a big application in CakePHP3, I want first use the new ORM in this CakePHP 2.6 application, any idea how to do that (and/or a good example) ?

Sulian

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: New CakePHP ORM to CakePHP 2.x

Sulian Lanteri
Hello José

I want to replace the 2.x orm system by the new ORM before upgrading to CakePHP3. My app have several modules, at last about 100 tables. I prefer migrate the ORM in CakePHP2 rather than migrating everything at once.

Le mardi 22 septembre 2015 10:57:01 UTC+2, José Lorenzo a écrit :
It depends. The ORM can be installed as a standalone library already, what kind of integration are you looking after?

On Tuesday, September 22, 2015 at 9:23:50 AM UTC+2, Sulian Lanteri wrote:
Hello

Before migrate a big application in CakePHP3, I want first use the new ORM in this CakePHP 2.6 application, any idea how to do that (and/or a good example) ?

Sulian

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: New CakePHP ORM to CakePHP 2.x

gersonfs
In reply to this post by Sulian Lanteri
Hello Sulian and José,

I have this problem too. Only much bigger. Because of that I have not yet adopted the CakePHP 3.

Migrating an application with 300 tables and business rules from CakePHP 2 to 3, it takes a long time, this transition should be possible to be made into parts.

I can not stop production completely to migrate becouse during this period of time the customer comes with new needs. A git merge does not apply in this case because the ORM is very different.

Any suggestion?

Em terça-feira, 22 de setembro de 2015 04:23:50 UTC-3, Sulian Lanteri escreveu:
Hello

Before migrate a big application in CakePHP3, I want first use the new ORM in this CakePHP 2.6 application, any idea how to do that (and/or a good example) ?

Sulian

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: New CakePHP ORM to CakePHP 2.x

Elisio Leonardo
In reply to this post by Sulian Lanteri
Also interested in this question.

Partial Migration would be great.

I'm looking for a way to migrate some models to new ORM and gradually migrate the others..



On Tuesday, September 22, 2015 at 9:23:50 AM UTC+2, Sulian Lanteri wrote:
Hello

Before migrate a big application in CakePHP3, I want first use the new ORM in this CakePHP 2.6 application, any idea how to do that (and/or a good example) ?

Sulian

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: New CakePHP ORM to CakePHP 2.x

Florian Krämer-2
In reply to this post by Sulian Lanteri
I don't get your problem guys. :) Add the new ORM via composer.

Just create the folders inside your 2.x app:
  • app/Model/Table
  • app/Model/Entity
Make sure your autoloader is finding the classes based on their namespace and put your tables and entities in there just as you would do it in Cake3. Then use the TableRegistry instead of the ClassRegistry to get your table objects. Just the fact that Cake2 is not using newer php language features doesn't mean you can't use them. You can create and use traits within your app as well to make getting tables more easy for example.

BUT: If you're after a magic "convert all and everything" to the new ORM, this is not going to happen, you'll have to do it by hand.

The way we do it is to slowly migrate what we need, when we need it. So we'll slowly replace the old with the new ORM, they can co-exist. This way we get the fancy new ORM but can slowly migrate our app as we go.

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.