public function Instance::export in Little helpers 7.2
Same name and namespace in other branches
- 7 src/Field/Instance.php \Drupal\little_helpers\Field\Instance::export()
Convert this object to an array suitable for the Drupal Field-API.
2 calls to Instance::export()
- Instance::delete in src/
Field/ Instance.php - Delete an existing field instance.
- Instance::save in src/
Field/ Instance.php - Save field instance to database.
File
- src/
Field/ Instance.php, line 107
Class
Namespace
Drupal\little_helpers\FieldCode
public function export() {
$data = (array) $this;
if (isset($data['field'])) {
unset($data['field']);
$data['field_name'] = $this->field->field_name;
$data['field_id'] = $this->field->id;
}
if (isset($data['bundle'])) {
unset($data['bundle']);
$data['bundle'] = $this->bundle
->getBundleName();
$data['entity_type'] = $this->bundle
->getEntityType();
}
return $data;
}