Retrieve custom columns in Symfony

Sometimes while retrieving data, you might not need all the columns, especially on a large database query result set.

Symfony, or actually Propel (1.3) allows you to chose what columns to retrieve, and skip the hydrate process:

// Custom column, on large subset
$c = new Criteria();
$resTitleRS = TitlePeer::doSelectStmt($c);
// Loop through result and create custom array
while ($row = $resTitleRS->fetch(PDO::FETCH_ASSOC)) {
  $title_id = $row['ID'];
  $title_name = $row['TITLE'];
  $arrTitleDB[$title_id] = $title_name;