A brand new tutorial about how to use Doctrine as a CI’s plugin :
http://www.phpandstuff.com/articles/codeigniter-doctrine-from-scratch-day-1-install-and-setup
It can give ideas ? Nope ?
This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.
The active forums are here.
November 01, 2009 1:31pm
Subscribe [12]#1 / Nov 01, 2009 1:31pm
A brand new tutorial about how to use Doctrine as a CI’s plugin :
http://www.phpandstuff.com/articles/codeigniter-doctrine-from-scratch-day-1-install-and-setup
It can give ideas ? Nope ?
#2 / Nov 01, 2009 4:10pm
Thanks for linking to my article 😊
Writing the 3rd episode right now.
#3 / Nov 06, 2009 3:27am
Hmm.. seems interesting 😊
#4 / Nov 06, 2009 8:29am
Good. Thanks.
#5 / Nov 06, 2009 3:04pm
For those interested, 3 more articles have been posted:
Day 2 - The Basics
http://www.phpandstuff.com/articles/codeigniter-and-doctrine-from-scratch-day-2-the-basics
Day 3 - Signup Form
http://www.phpandstuff.com/articles/codeigniter-doctrine-scratch-day-3-user-signup-form
Day 4 - User Login
http://www.phpandstuff.com/articles/codeigniter-doctrine-scratch-day-4-user-login
#6 / Nov 16, 2009 7:50am
a good series, thanks lane4.
#7 / Nov 16, 2009 8:14am
@lane - I like the clean code you get in the controller by putting the form_validation in a function(_submit_validate()). I’m going to nick that idea. Great stuff!
#8 / Nov 16, 2009 8:30am
Great! Thanks!! 😊
#9 / Nov 16, 2009 3:15pm
Thanks everyone.
Day 5 and Day 6 have been posted, and more of them are coming very soon.
#10 / Nov 16, 2009 8:37pm
You’ve done a huge amount of work here and I’m sure it’s greatly appreciated by the community.
From my experience using MVC I’ve concluded that it’s not such a good idea to use any data objects in the controller directly.
Doing this then requires all of your application business logic to be in the controller also when it should really be in your models.
The model should encapsulate the Doctrine objects rather than being replaced by them. Even your diagram (in Part 1) shows business logic being in models but your code examples don’t.
Maybe at some point you could give examples of how a model might encapsulate the Doctrine data objects. Thanks.
#11 / Nov 16, 2009 8:52pm
You’ve done a huge amount of work here and I’m sure it’s greatly appreciated by the community.
I’m beginning to believe that it’s not such a good idea to use any data objects in the controller directly.
Doing this then requires all of your application business logic to be in the controller also when it should really be in your models.
The model should encapsulate the Doctrine objects rather than being replaced by them. Even your diagram (in Part 1) shows business logic being in models but your code examples don’t.
Can you be more specific? I am open to suggestions.
#12 / Nov 16, 2009 9:05pm
I thought that was specific.
Business logic is that logic that makes your application function and is not related to the request, input validation or the response.
The business logic is that which might ensure a user does not register with a username of `Administrator` or that some monetary value when multiplied by some other value does not end up being a negative number etc.
Your models in an MVC context, are supposed to provide this logic. Your data objects should be encapsulated by the model and used in context of the application business logic.
#13 / Nov 16, 2009 9:18pm
hi there,
just want to ask if ORM support xampp? haven’t tried yet ORM. :D
thanks
#14 / Nov 16, 2009 9:27pm
I thought that was specific.
Business logic is that logic that makes your application function and is not related to the request, input validation or the response.
The business logic is that which might ensure a user does not register with a username of `Administrator` or that some monetary value when multiplied by some other value does not end up being a negative number etc.
Your models in an MVC context, are supposed to provide this logic.
Doctrine does have support for Data Validation, and it’s actually more extensive than the CI form_validation class. And it also supports custom validators, where you could for example check for special usernames like (‘Administrator’) as you just mentioned.
I am already planning on making that part of an upcoming episode.
The thing is, I just can’t present all the concepts at once in the very first Model I create in the tutorials. I need to go at a certain pace, as these are meant to be readable by beginners in CI and Doctrine.
Thanks for bringing it up though. If you have any other specific suggestions let me know.
#15 / Nov 16, 2009 9:28pm
hi there,
just want to ask if ORM support xampp? haven’t tried yet ORM. :D
thanks
It should work, as long as PDO is enabled with MySQL support (unless you want to use a different db driver).