Welcome Guest, Not a member yet? Register   Sign In
[SOLVED] pre-defined column names for dates in tables
#1

[eluser]Jay Gilford[/eluser]
Hi, I was just wondering if there are pre-defined column names for dates in CI
For example, in CakePHP there is the created and updated fields that automatically change when created/updated to the correct time values. Does CI have this?

Many thanks

Jay
#2

[eluser]Cro_Crx[/eluser]
Nothing like that is done automatically by CI. If you use an ORM library for CI (there's a few around) you can get the same functionality of Cake.

Try out DMZ http://www.overzealous.com/dmz/pages/toc.html It automatically generates updated/created fields for you.
#3

[eluser]Jay Gilford[/eluser]
Thanks for the reply. Can you explain what it is you mean by an "ORM library" please. I'm not familiar with the term
#4

[eluser]Cro_Crx[/eluser]
In CakePHP each of your models can be used as objects. So if you have a page object you can do something like this $page = new Page(); to create a new instance of Page. CodeIgniter doesn't have this inbuilt, instead the models contain commonly used functions to retrieve data.

Cakes version of doing this is called Object Relational Mapping. Basically each model you create maps to a table in your relational database. Because of this Cake can do things like automatically set the updated/created times and generally makes your applications shorter and neater.

You can achieve the same thing with CI, although it's not inbuilt into the core. Instead there are quite a few libraries you can use which will do this for you. Here's some more info on ORM http://en.wikipedia.org/wiki/Object-relational_mapping
#5

[eluser]Jay Gilford[/eluser]
I see. Thankyou very much for your time Cro_Crx. It's most appreciated Smile




Theme © iAndrew 2016 - Forum software by © MyBB