You are here

public function Field::setType in Little helpers 7

Same name and namespace in other branches
  1. 7.2 src/Field/Field.php \Drupal\little_helpers\Field\Field::setType()

Load default data for this field-type.

See also

\field_create_field()

File

src/Field/Field.php, line 58

Class

Field
OOP-wrapper for the data-structure used by field_*_field() functions.

Namespace

Drupal\little_helpers\Field

Code

public function setType($type) {
  $field_type = \field_info_field_types($type);
  $this->settings += \field_info_field_settings($type);
  $this->module = $field_type['module'];
  $this->type = $type;
}