title: Is it possible to fetch the names of the fields a table has, using Datamapper with Codeigniter?
body: <p>I need to fetch the fields from a table so I can check if that particular table will accept a key/value pair. Is it possible to fetch only the field names?
  I'm using <a href="http://datamapper.wanwizard.eu" rel="nofollow noreferrer">Datamapper</a> with Codeigniter.</p>
  
  <p>EDIT:</p>
  
  <p>Example:</p>
  
  <pre><code>//Controller
  foreach($entity-&gt;allowedFields() as $key=&gt;$value)
  {
    $entity-&gt;$key = $value;
  }
  
  //Entity Model
  function allowedFields()
  {
    return $this-&gt;tableKeysAsArray;
  }
  </code></pre>