public function getListsNamesByItemI itemID db this- getDefaultAdapter

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
public function getListsNamesByItemID($itemID)
{
$db = $this->getDefaultAdapter();
$select = $db->select()
->from(array('l' => DB_PREFIX . 'lists'), array('l.name', 'l.id'))
->join(array('li' => DB_PREFIX . 'list_items'), 'li.list_id = l.id', null)
->order('name ASC')
->where('li.item_id = ?', $itemID);
return $select->query()->fetchAll(Zend_Db::FETCH_COLUMN);
}