/** * Creates a text_with_summary field storage and field. * * @param string $entity_type * Entity type for which the field should be created. */ protected function createField($entity_type) { // Create a field . $this->fieldStorage = entity_create('field_storage_config', array('field_name' => 'summary_field', 'entity_type' => $entity_type, 'type' => 'text_with_summary', 'settings' => array('max_length' => 10))); $this->fieldStorage->save(); $this->field = entity_create('field_config', array('field_storage' => $this->fieldStorage, 'bundle' => $entity_type)); $this->field->save(); }
/** * Creates a geofield field storage and field. * * @param string $entity_type * Entity type for which the field should be created. */ protected function createField($entity_type) { // Create a field . $this->fieldStorage = entity_create('field_storage_config', array('field_name' => 'geofield_field', 'entity_type' => $entity_type, 'type' => 'geofield', 'settings' => array('backend' => 'geofield_backend_default'))); $this->fieldStorage->save(); $this->field = entity_create('field_config', array('field_storage' => $this->fieldStorage, 'bundle' => $entity_type)); $this->field->save(); }