Example #1
0
 public function formatDisplay($key, &$attributes, \GO\Customfields\Model\AbstractCustomFieldsRecord $model)
 {
     if (!empty($this->field->multiselect) && isset($attributes[$key])) {
         $attributes[$key] = str_replace('|', ', ', $attributes[$key]);
     }
     return parent::formatDisplay($key, $attributes, $model);
 }
Example #2
0
 public function validate($value)
 {
     if ($value === false || !empty($value) && !is_numeric($value)) {
         return false;
     }
     return parent::validate($value);
 }
Example #3
0
 public function formatFormOutput($key, &$attributes, \GO\Customfields\Model\AbstractCustomFieldsRecord $model)
 {
     if (!\GO\Customfields\Model\AbstractCustomFieldsRecord::$formatForExport) {
         return parent::formatFormOutput($key, $attributes, $model);
     } else {
         return $this->getName($attributes[$key]);
     }
 }