/** * Get a list of email of all the customers * @return array */ public static function getEmailList($empty = false) { $items = array(); $registry = Shineisp_Registry::getInstance(); $translations = $registry->Zend_Translate; if ($empty) { $items[] = $translations->translate('Select ...'); } $customer = Doctrine_Query::create()->from('Customers c')->andWhere("c.isp_id = ?", Isp::getCurrentId())->orderBy('lastname, firstname, company')->execute(array(), Doctrine_Core::HYDRATE_ARRAY); foreach ($customer as $c) { $items[$c['customer_id']] = Shineisp_Commons_Utilities::Capitalize($c['emaillastname'] . " (" . $c['email'] . ")", true); if (!empty($c['company'])) { $items[$c['customer_id']] .= " - " . ucwords($c['company']); } } return $items; }