Welcome Guest, Not a member yet? Register   Sign In
ActiveRecord for CodeIgniter: Rails-style model interactions
#48

[eluser]chrisj[/eluser]
[quote author="wiredesignz" date="1191854883"]
$this->person->deleteAll()
Empties the people table!
My understanding of encapsulation is that an object (here representing a table row), should not have any method which affects another object.
Please correct me if I'm mistook.[/quote]

Yeah, this function scares the hell out of me. I've commented it out of my version. It seems to me if you have a table that you want to empty often (like a session table or something) you'd want to implement this in the child class, and it'd be just as easy as:

Code:
$this->db->query('TRUNCATE TABLE '.$this->_table);

[quote author="chromice" date="1193310405"]I wonder why there are so many eval(...) statements in this library? Is it to tackle bugs in some version of PHP5 or something? Am I missing something?[/quote]

I've been asking myself the same question. I've converted most of the eval commands in my copy like you describe here, and it seems to run just fine on PHP5. I thought maybe it was for PHP4 compatibility. I'm not really a php expert so I'm hesitant to justify it myself.


Messages In This Thread
ActiveRecord for CodeIgniter: Rails-style model interactions - by El Forum - 10-25-2007, 06:39 AM



Theme © iAndrew 2016 - Forum software by © MyBB