public function processData($data, Entry $entry = NULL) { $states = array('on', 'yes'); if ($this->{'required'} == 'yes' && !in_array(strtolower($data), $states)) { $data = null; } else { $data = in_array(strtolower($data), $states) ? 'yes' : 'no'; } return parent::processData($data, $entry); }