/**
  * @return array - Jui AutoComplete ready array
  *  containing value and label elements.
  */
 public static function getByPartialCodeOrName($partialCodeOrName)
 {
     $autoCompleteResults = array();
     $codesAndNames = ZurmoCurrencyCodes::getByPartialCodeOrName($partialCodeOrName);
     foreach ($codesAndNames as $code => $name) {
         $autoCompleteResults[] = array('value' => $code, 'label' => $code . ' ' . $name);
     }
     return $autoCompleteResults;
 }
 /**
  * @return array - Jui AutoComplete ready array
  *  containing value and label elements.
  */
 public static function getByPartialCodeOrName($partialCodeOrName, $autoCompleteOptions = null)
 {
     // autoCompleteOptions is not used but here for future uses.
     $autoCompleteResults = array();
     $codesAndNames = ZurmoCurrencyCodes::getByPartialCodeOrName($partialCodeOrName);
     foreach ($codesAndNames as $code => $name) {
         $autoCompleteResults[] = array('value' => $code, 'label' => $code . ' ' . $name);
     }
     return $autoCompleteResults;
 }
 public function testGetByPartialCodeOrName()
 {
     $data = ZurmoCurrencyCodes::getByPartialCodeOrName('eu');
     $compareData = array('EUR' => 'Euro Member Countries', 'MDL' => 'Moldova Leu', 'RON' => 'Romania New Leu');
     $this->assertEquals($compareData, $data);
     $data = ZurmoCurrencyCodes::getByPartialCodeOrName('EU');
     $this->assertEquals($compareData, $data);
     $data = ZurmoCurrencyCodes::getByPartialCodeOrName('zasd');
     $this->assertEquals(array(), $data);
     $data = ZurmoCurrencyCodes::getByPartialCodeOrName('falk');
     $compareData = array('FKP' => 'Falkland Islands (Malvinas) Pound');
     $this->assertEquals($compareData, $data);
 }