title: Codeigniter Best Practices for Model functions
body: <p>Say my application has a "Posts" model, and one of the function is <code>add_post()</code>, it might be something like:</p>
  
  <pre><code>function add_post($data) {
  
      $this-&gt;db-&gt;insert('posts',$data);
  
  }
  </code></pre>
  
  <p>Where $data is an array:</p>
  
  <pre><code>$data = array ('datetime'=&gt;'2010-10-10 01:11:11', 'title'=&gt;'test','body'=&gt;'testing');
  </code></pre>
  
  <p>Is this best practice? It means if you use that function you need to know the names of the database fields where as my understanding of OOP is that you shouldnt need to know how the method works etc etc</p>