public function Field::save in Little helpers 7.2
Same name and namespace in other branches
- 7 src/Field/Field.php \Drupal\little_helpers\Field\Field::save()
Save field configuration to database.
See also
File
- src/
Field/ Field.php, line 70
Class
- Field
- OOP-wrapper for the data-structure used by field_*_field() functions.
Namespace
Drupal\little_helpers\FieldCode
public function save() {
if (isset($this->id)) {
\field_update_field((array) $this);
}
else {
foreach (\field_create_field((array) $this) as $k => $v) {
$this->{$k} = $v;
}
}
return $this;
}