Love Fuel?
Donate
About
Forums
Discussions
Login
FuelPHP Forums
Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
General
How can I find a result from Model to return Array, Not object
hewenxiang
December 2012
How can I find a result from Model to return Array, Not object
ilNotturno
December 2012
You can use the "to_array()" function:
$user
= Model_User::find_by_pk(
2
)
->to_array()
;
hewenxiang
December 2012
ErrorException [ Error ]: Call to undefined method Orm\Query::to_array()
ilNotturno
December 2012
Can you post some code? The code I posted worked for me in another project.
Harro
December 2012
What does "
Model_User::find_by_pk(
2
)
" return? It might return NULL if the record is not found.
Add a Comment
Howdy, Stranger!
It looks like you're new here. If you want to get involved, click one of these buttons!
Sign In
Apply for Membership
Categories
All Discussions
5,088
General
↳ General
3,364
↳ Job Board
13
↳ Installation & Setup
214
Packages
↳ Oil
213
↳ Orm
700
↳ Auth
260
Development
↳ Tips and Tutorials
126
↳ Code share
145
↳ Applications
52
In this Discussion
Harro
December 2012
hewenxiang
December 2012
ilNotturno
December 2012