title: Magento SELECT via ORM
body: <p>I would like to know how can I do a SELECT from a Magento core table but not using pure SQL but using collections.</p>
  
  <p>Currently, inside a class that extends Mage_Core_Model_Abstract, on a given function I have the following code:</p>
  
  <pre><code>$resource = Mage::getSingleton("core/resource");
  
  $tableName_SalesQuoteItem = $resource-&gt;getTableName("sales/quote_item");
  
  $readConnection = $resource-&gt;getConnection("core_read");
  
  $sqlInstruction = "SELECT item_id FROM {$tableName_SalesQuoteItem} WHERE sku = :sku AND quote_id = :quote_id;";
  
  $binds = array("sku" =&gt; $itemSku, "quote_id" =&gt; $quoteID);
  
  $result = $readConnection-&gt;query($sqlInstruction, $binds);
  
  if($row = $result-&gt;fetch()) {
      $currentItemID = $row["item_id"];
  }
  </code></pre>
  
  <p>Any ideas?</p>
  
  <p>Thanks!</p>