• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Database Advancement

#1
Good day, would like to know if the db classes/ structure would support advanced feature like Laravel?

features like date/time casting, model relationships and more
Reply

#2
It's not an ORM like Eloquent, nor will it ever be. There have been some improvements, and will likely continue to see a few more come along, most likely through the Entity class, should you decide to use that, though the Model class does have some actual features now, instead of just loading the database and providing a link to the CI superglobal.

The docs are your best source of truth for that.
Practical CodeIgniter 3  • CodeIgniter 4 Foundations - Coming Soon • Vulcan - CLI Tools for CI4
Reply

#3
(07-26-2017, 09:48 PM)kilishan Wrote: It's not an ORM like Eloquent, nor will it ever be. There have been some improvements, and will likely continue to see a few more come along, most likely through the Entity class, should you decide to use that, though the Model class does have some actual features now, instead of just loading the database and providing a link to the CI superglobal.

The docs are your best source of truth for that.

ok, noting this line "It's not an ORM like Eloquent, nor will it ever be" i read the entity doc and also tried implementing. its cool, but don't you think defining each entity is a way long process especially when my tables columns are much. the returntype should be able to use the model as a return type. i know this might alter the Entity behavior, but it wouldn't need defining entities separately but the main entity class used as a trait in the model.

just saying, cus i ran into some snag while testing. so i did some modification which to an extent solved some of the snag.
Reply

#4
(07-27-2017, 04:54 AM)scalla Wrote: ok, noting this line "It's not an ORM like Eloquent, nor will it ever be" i read the entity doc and also tried implementing. its cool, but don't you think defining each entity is a way long process especially when my tables columns are much.

If it becomes a burden, that's when you make automation tools to help streamline your workflow.

(07-27-2017, 04:54 AM)scalla Wrote: the returntype should be able to use the model as a return type. i know this might alter the Entity behavior, but it wouldn't need defining entities separately but the main entity class used as a trait in the model.

just saying, cus i ran into some snag while testing. so i did some modification which to an extent solved some of the snag.

What you're describing is part of the ActiveRecord pattern where the representation of of the db row can save itself back, like Eloquent. What we have here is not trying to follow ActiveRecord, and honestly I'm not a big fan of the ActiveRecord pattern. The Entity class is part of the Repository pattern which keeps the representation of the data (the entity) separate from how it's persisted. By divorcing the representation itself from how it's stored it creates much more long-term flexibility and stability.

Note: I use Laravel daily at the company I'm in, so I'm very familiar with it and why people like it, but still not a fan of that pattern.
Practical CodeIgniter 3  • CodeIgniter 4 Foundations - Coming Soon • Vulcan - CLI Tools for CI4
Reply

#5
(07-27-2017, 07:07 AM)kilishan Wrote: What you're describing is part of the ActiveRecord pattern where the representation of of the db row can save itself back, like Eloquent. What we have here is not trying to follow ActiveRecord, and honestly I'm not a big fan of the ActiveRecord pattern. The Entity class is part of the Repository pattern which keeps the representation of the data (the entity) separate from how it's persisted. By divorcing the representation itself from how it's stored it creates much more long-term flexibility and stability.

Note: I use Laravel daily at the company I'm in, so I'm very familiar with it and why people like it, but still not a fan of that pattern.

agreeable, i just started using laravel about a month ago, it's fun. but its so deep, that's why i look forward to codeigniter having some enhanced database feature like the model relationship and more.
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


Users browsing this thread:
1 Guest(s)


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2017 MyBB Group.