isPrimaryDepartmentActive()) { $options[]=array('value' => '', 'label' => Mage::helper('aw_hdu3')->__('--Please select--')); } $departmentCollection = Mage::getModel('aw_hdu3/department')->getCollection(); $departmentCollection ->sortByOrder() ->addActiveFilter() ; foreach ($departmentCollection->toOptionHash() as $value => $label) { if ($excludeDepId != $value) { $options[] = array('value' => $value, 'label' => $label); } } return $options; } /** * @param null|int $storeId * * @return array */ static public function toOptionArrayForStoreId($storeId = null) { if (null === $storeId) { $storeId = Mage::app()->getStore()->getId(); } $options = array(array('value' => '', 'label' => Mage::helper('aw_hdu3')->__('--Please select--'))); $departmentCollection = Mage::getModel('aw_hdu3/department')->getCollection(); $departmentCollection ->addFilterByStoreId($storeId) ->sortByOrder() ->addActiveFilter() ; foreach ($departmentCollection->toOptionHash() as $value => $label) { $options[] = array('value' => $value, 'label' => $label); } return $options; } }