• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Destructor and Database Connection

#1
[eluser]petewulf[/eluser]
Hello there,

i'm new to codeigniter and currently developing my first project with it. I have implemented many own classes which have to interact with the database itself and have to read data in the Constructor and write them back in the Destructor.

The Problem is, that when the Destructor on my own class is called, the Database connection is already closed by CI and i have to manually reconnect or create a method which is called at the end of the code. This is not a very smooth way to code i think so my question is if there is any possibility to close the CI_DB later?

Wouldn't it be a nice feature if the classes are destructed from 'inside' to 'outside', so that all CI core functions are still accessible till the end?

Regards,
Daniel


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.