Пример #1
0
 /**
  * get the value
  *
  * @param array $data
  * @param int $repeatCounter
  * @param array options
  * @return unknown
  */
 function getValue($data, $repeatCounter = 0, $opts = array())
 {
     //cludge for 2 scenarios
     if (array_key_exists('rowid', $data)) {
         //when validating the data on form submission
         $key = 'rowid';
     } else {
         //when rendering the element to the form
         $key = '__pk_val';
     }
     if (empty($data) || !array_key_exists($key, $data) || array_key_exists($key, $data) && empty($data[$key])) {
         // $$$rob - if no search form data submitted for the search element then the default
         // selection was being applied instead
         if (array_key_exists('use_default', $opts) && $opts['use_default'] == false) {
             $value = '';
         } else {
             $value = $this->getDefaultValue($data);
         }
         return $value;
     }
     $res = parent::getValue($data, $repeatCounter, $opts);
     return $res;
 }