Passing a class name to CI_DB_result::result() |
[eluser]Joseph Wynn[/eluser]
Hi there, The documentation for result() says that you can pass it the name of a class to instantiate for each result object: http://ellislab.com/codeigniter/user-gui...sults.html This is not the case; result() either returns a StdClass object or an array. There is no logic whatsoever that looks for a class to instantiate. I'm curious to know why this feature (and it's a really good feature!) is documented when it doesn't actually exist?
[eluser]danmontgomery[/eluser]
Sure there is... https://bitbucket.org/ellislab/codeignit....php#cl-48 Code: /**
[eluser]Joseph Wynn[/eluser]
Ah, my apologies. Do you know in which version this was added? I should have stated in my original post that I noticed this while working on an ExpressionEngine project, which I now realise may not be running the latest version of CodeIgniter. Thanks for your reply.
[eluser]Aken[/eluser]
My EE install says it's running CI 2.0.1, which is going to be CI Core and not Reactor. It was committed to Reactor on January 15th 2011. It has not been added to Core yet, or EE.
[eluser]Aken[/eluser]
Sure thing. You could always extend the file or replace it in your EE install if you need to use it. It wasn't much added code. |
Welcome Guest, Not a member yet? Register Sign In |