53 if (is_string($value))
55 $value = strip_tags($value);
56 $value = preg_replace(
'/[\s]{2,}/',
' ', $value);
57 $value = trim($value);
69 public static function prepareFieldDefinition(array $field)
71 $field = array_change_key_case($field, CASE_LOWER);
72 $field[
'id'] = static::prepareStringValue($field,
'id');
73 $field[
'type'] = static::prepareStringValue($field,
'type');
74 $field[
'name'] = static::prepareStringValue($field,
'name');
75 if (empty($field[
'id']) || empty($field[
'type']) || empty($field[
'name']))
81 $className = Node\Type::getClassName($field[
'type']);
82 if (!class_exists($className))
86 return $className::validateFieldDefinition($field);
97 'type' => $field[
'type'],
98 'name' => $field[
'name']
109 if (empty($row[$name]) || !is_string($row[$name]))
113 $row[$name] = trim($row[$name]);
114 if ($row[$name] ===
'')