• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
MY_Model best library ?

#11
[eluser]Phil Sturgeon[/eluser]
CodeIgniter forum is a great place to meet people and share.

Google is a great place to find out commonly asked questions.

If its not on Google, then feel free to share your question here and we will be happy to help. ;-)

@Jamie: Not so sure about some of your MY_Model functions. I've been re-coding some of it (just small tweaks so far) and I noticed:

Code:
public function delete_by($key, $val)
    {
        return $this->db->where($key, $val)
            ->delete($this->table_name);
    }

and

Code:
public function delete_many_by($where)
    {
        return $this->db->where($where)
            ->delete($this->table_name);
    }

I am trying to think of a better name here, as delete_by could delete many and delete_many_by() could easily only delete one record. Update and delete cannot be named by the number of results their criteria could match against, as we clearly have no idea what is in the database.

Can anyone think of a better name?

#12
[eluser]jeanv[/eluser]
Thanks Phil! Your link was pretty funny by the way, and i recognized that for common questions it's better to aske google than to disturb hard workers! ;-)

#13
[eluser]Mark Croxton[/eluser]
What about simply delete() and delete_where() ?


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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