public function normalize($input, $property, model_editor $editor) { $input = parent::normalize($input, $property, $editor); if ($input !== null) { $junctor = $this->separator[0]; $items = preg_split('/[' . preg_quote($this->separator) . ']/', $input); $items = array_map(function ($n) { return trim($n); }, $items); $items = array_filter($items, function ($n) { return $n !== ''; }); $input = implode("{$junctor} ", $items); } return $input; }