public function bind(array $taintedValues = null, array $taintedFiles = null) { // the line below is used to avoid with_multimedia checkbox to remains checked when we click to back to criteria if (!isset($taintedValues['with_multimedia'])) { $taintedValues['with_multimedia'] = false; } if (isset($taintedValues['Codes']) && is_array($taintedValues['Codes'])) { foreach ($taintedValues['Codes'] as $key => $newVal) { if (!isset($this['Codes'][$key])) { $this->addCodeValue($key); } } } else { $this->offsetUnset('Codes'); $subForm = new sfForm(); $this->embedForm('Codes', $subForm); $taintedValues['Codes'] = array(); } if (isset($taintedValues['Tags']) && is_array($taintedValues['Tags'])) { foreach ($taintedValues['Tags'] as $key => $newVal) { if (!isset($this['Tags'][$key])) { $this->addGtuTagValue($key); } } } else { $this->offsetUnset('Tags'); $subForm = new sfForm(); $this->embedForm('Tags', $subForm); $taintedValues['Tags'] = array(); } parent::bind($taintedValues, $taintedFiles); }
public function bind(array $taintedValues = null, array $taintedFiles = null) { if (!isset($taintedValues['search_type']) || $taintedValues['search_type'] == '') { $taintedValues['search_type'] = 'zoo'; } if (!isset($taintedValues['col_fields']) || $taintedValues['col_fields'] == '') { if ($taintedValues['search_type'] == 'zoo') { $taintedValues['col_fields'] = 'collection|gtu|sex|stage|type'; } else { $taintedValues['col_fields'] = 'collection|gtu'; } } parent::bind($taintedValues, $taintedFiles); }