title: Get attribute of foreach magento object
body: <p>I have a big array that I want to save in database.
  My code line <code>$model = Mage::getModel('thorleif/category')-&gt;setData($arr);</code>
  return the following result</p>
  
  <pre><code>object(Ns_Thorleif_Model_Category)#298 (15) { ["_eventPrefix":protected]=&gt; string(13) "core_abstract" ["_eventObject":protected]=&gt; string(6) "object" ["_resourceName":protected]=&gt; string(17) "thorleif/category" ["_resource":protected]=&gt; NULL ["_resourceCollectionName":protected]=&gt; string(28) "thorleif/category_collection" ["_cacheTag":protected]=&gt; bool(false) ["_dataSaveAllowed":protected]=&gt; bool(true) ["_isObjectNew":protected]=&gt; NULL ["_data":protected]=&gt; array(5065) { [0]=&gt; array(3) { ["id_linio_category"]=&gt; int(18784) ["name"]=&gt; string(8) "Mascotas" ["level"]=&gt; int(0) } [1]=&gt; array(3) { ["id_linio_category"]=&gt; int(18893) ["name"]=&gt; string(6) "Perros" ["level"]=&gt; int(1) } [2]=&gt; array(3) { ["id_linio_category"]=&gt; int(18973) ["name"]=&gt; string(27) "Camas y Muebles para perros" ["level"]=&gt; int(2) } [3]=&gt; array(3) { ["id_linio_category"]=&gt; int(18985) ["name"]=&gt; string(16) "Casa para Perros" ["level"]=&gt; int(3) } [4]=&gt; array(3) { ["id_linio_category"]=&gt; int(18984) ["name"]=&gt; string(21) "Colchones para perros" ["level"]=&gt; int(3) } [5]=&gt; array(3) { ["id_linio_category"]=&gt; int(18983) ["name"]=&gt; string(17) "Camas para Perros" ["level"]=&gt; int(3) } [6]=&gt; array(3) { ["id_linio_category"]=&gt; int(18982) ["name"]=&gt; string(29) "Camas de Plastico para Perros" ["level"]=&gt; int(3) } [7]=&gt; array(3) { ["id_linio_category"]=&gt; int(18981) ["name"]=&gt; string(29) "Camas Ortopedicas para Perros" ["level"]=&gt; int(3) } [8]=&gt; array(3) { ["id_linio_category"]=&gt; int(18980) ["name"]=&gt; string(19) "Tapetes para Perros" ["level"]=&gt; int(3) } [9]=&gt; array(3) { ["id_linio_category"]=&gt; int(18979) ["name"]=&gt; string(30) "Almohadas y Fundas para perros" ["level"]=&gt; int(3) } [10]=&gt; array(3) { ["id_linio_category"]=&gt; int(18978) ["name"]=&gt; string(20) "Corrales para Perros" ["level"]=&gt; int(3) } [11]=&gt; array(3) { ["id_linio_category"]=&gt; int(18977) ["name"]=&gt; string(27) "Puertas y Rejas para Perros" ["level"]=&gt; int(3) }
  </code></pre>
  
  <p>How can I get value from the foreach for each attribute? Thanks</p>