-
Website
http://www.phpfour.com/blog -
Original page
http://www.phpfour.com/blog/2009/02/updated-http-class-extended-model-codeigniter-cross-domain-ajax-php/ -
Subscribe
All Comments -
Community
-
Top Commenters
-
robskils
1 comment · 1 points
-
joshsharp
1 comment · 1 points
-
nirjhar
1 comment · 1 points
-
Nhm Tanveer Hossain Khan
1 comment · 1 points
-
cubanhenry5
1 comment · 1 points
-
-
Popular Threads
Many thanks for these excellent classes!
I've used the Extended Model class in a recent project and it saved me so much time in not having to create the simple Models just to do basic insert, save, findAll etc. Great work!
When I use $returnArray = FALSE, findCount() got error. So I changed this code:
$data = $this->findAll($conditions, 'COUNT(*) AS count', null, 0, 1);
if ($data)
{
return $data[0]['count'];
}
to this:
$data = $this->findAll($conditions, 'COUNT(*) AS count', null, 0, 1);
if ($data)
{//fixed by starrynighthn
if ($this->returnArray)
return $data[0]['count'];
else
return $data[0]->count;
}
and everything works well.
Hope you fix this bug. ;)
I was wondering if you could post some sample code showing how you generally use the extended model, specifically when creating a new record.
Thanks.
Great job on this! I was testing it out and it worked perfectly.
One thing though--is it possible to join tables with this? For example, if you have two tables such as 'products' and another called 'images', where product image names are stored in the images table. How would you do the combine and throw in a condition?
At this moment JOIN is not supported within this class. The purpose of this
class is to assist with most regular DB operation, not the complex ones. I
believe when using JOIN, the query should be hand-written with proper
ordering etc.
Glad this is helping you!
Emran