Welcome Guest, Not a member yet? Register   Sign In
model logic
#1

[eluser]Unknown[/eluser]
I'm testing out CI for the first time and looking over the tutorial which declares a model. The model has no properties, it just has functions. This isn't really OO now is it?

http://ellislab.com/codeigniter/user-gui...ction.html

In the news example, shouldn't we declare the id, title, slug and all data and then when we load an instance of news it sets them to blank and if we pass the slug it populates the properties?

This seems like a procedural class as all it does is contain functions?

I have some experience with doctrine and they have what they call entities which store the data model of the object and the repository which runs the functions. So if you want to do a return all, a search or pull just one object, you would call the repository which references the object and passes back either an object or an array of objects.

How can we do this with CI?




Theme © iAndrew 2016 - Forum software by © MyBB