I am trying to do what I thought would be a trivial task using Symfony 1.4 with the propel ORM. I've got a custom static class setup that I would like to use to return the id of a row by searching the name of the item.
Here's my function:
static public function getItemIdByName ( $name )
{
$criteria = new Criteria();
$criteria-> clearSelectColumns();
$criteria -> add (ItemsPeer::ITEM_NAME, $name, Criteria::LIKE );
$criteria -> addSelectColumn(ItemsPeer::ITEM_ID);
$criteria -> setLimit (1);
$itemID = ItemsPeer::doSelect( $criteria );
return $itemID;
}
Now when I return $itemID, I get the name of the item. However, I cannot get the item_id column at all. I've tried returning $itemID[1] and several other column indexes, but it says those do not exist. If I print_r($itemID), I see an array of every column in that table, the only two with values are item_id and item_name. However, I still can't find a way to return or access that variable.
Any suggestions?