diff --git a/core/modules/field/field.api.php b/core/modules/field/field.api.php index 095c28d..c38da00 100644 --- a/core/modules/field/field.api.php +++ b/core/modules/field/field.api.php @@ -153,8 +153,9 @@ function hook_field_extra_fields_alter(&$info) { * the field type module depends on). * - no_ui: (optional) A boolean specifying that users should not be allowed * to create fields and instances of this field type through the UI. Such - * fields can only be created programmatically with field_create_field() - * and field_create_instance(). Defaults to FALSE. + * fields can only be created programmatically with + * entity_create('field_entity') and entity_create('field_instance'). + * Defaults to FALSE. * * @see hook_field_info_alter() */ @@ -229,8 +230,8 @@ function hook_field_info_alter(&$info) { * storage. * - indexes: (optional) An array of Schema API index definitions. Only * columns that appear in the 'columns' array are allowed. Those indexes - * will be used as default indexes. Callers of field_create_field() can - * specify additional indexes or, at their own risk, modify the default + * will be used as default indexes. Callers of entity_create('field_entity') + * can specify additional indexes or, at their own risk, modify the default * indexes specified by the field-type module. Some storage engines might * not support indexes. * - foreign keys: (optional) An array of Schema API foreign key definitions. @@ -534,7 +535,7 @@ function hook_field_update(\Drupal\Core\Entity\EntityInterface $entity, $field, /** * Update the storage information for a field. * - * This is invoked on the field's storage module from field_update_field(), + * This is invoked on the field's storage module from update of field entity, * before the new field information is saved to the database. The field storage * module should update its storage tables to agree with the new field * information. If there is a problem, the field storage module should throw an @@ -1626,7 +1627,7 @@ function hook_field_storage_query($query) { /** * Act on creation of a new field. * - * This hook is invoked from field_create_field() to ask the field storage + * This hook is invoked from field entity creation to ask the field storage * module to save field information and prepare for storing field instances. If * there is a problem, the field storage module should throw an exception. * @@ -1644,7 +1645,7 @@ function hook_field_storage_create_field($field) { /** * Act on deletion of a field. * - * This hook is invoked from field_delete_field() to ask the field storage + * This hook is invoked from deletion of field entity to ask the field storage * module to mark all information stored in the field for deletion. * * @param $field @@ -1671,7 +1672,7 @@ function hook_field_storage_delete_field($field) { /** * Act on deletion of a field instance. * - * This hook is invoked from field_delete_instance() to ask the field storage + * This hook is invoked from deletion of field instance to ask the field storage * module to mark all information stored for the field instance for deletion. * * @param $instance @@ -1885,8 +1886,8 @@ function hook_field_widget_properties_ENTITY_TYPE_alter(array &$widget_propertie /** * Act on a field being created. * - * This hook is invoked from field_create_field() after the field is created, to - * allow modules to act on field creation. + * This hook is invoked from field entity creation after the field is created, + * to allow modules to act on field creation. * * @param $field * The field just created. @@ -1898,7 +1899,7 @@ function hook_field_create_field($field) { /** * Act on a field instance being created. * - * This hook is invoked from field_create_instance() after the instance record + * This hook is invoked from field instance creation after the instance record * is saved, so it cannot be used to modify the instance itself. * * @param $instance @@ -1951,7 +1952,7 @@ function hook_field_update_forbid($field, $prior_field, $has_data) { /** * Act on a field being updated. * - * This hook is invoked just after field is updated in field_update_field(). + * This hook is invoked just after field entity is updated. * * @param $field * The field as it is post-update. @@ -1968,7 +1969,7 @@ function hook_field_update_field($field, $prior_field, $has_data) { /** * Act on a field being deleted. * - * This hook is invoked just after a field is deleted by field_delete_field(). + * This hook is invoked just after a field entity is deleted. * * @param $field * The field just deleted. @@ -1980,7 +1981,7 @@ function hook_field_delete_field($field) { /** * Act on a field instance being updated. * - * This hook is invoked from field_update_instance() after the instance record + * This hook is invoked from field instance saving after the instance record * is saved, so it cannot be used by a module to modify the instance itself. * * @param $instance @@ -1995,8 +1996,7 @@ function hook_field_update_instance($instance, $prior_instance) { /** * Act on a field instance being deleted. * - * This hook is invoked from field_delete_instance() after the instance is - * deleted. + * This hook is invoked after the field instance is deleted. * * @param $instance * The instance just deleted. diff --git a/core/modules/field/field.crud.inc b/core/modules/field/field.crud.inc index 3138b00..b242aba 100644 --- a/core/modules/field/field.crud.inc +++ b/core/modules/field/field.crud.inc @@ -55,6 +55,9 @@ * * @throws Drupal\field\FieldException * + * @deprecated as of Drupal 8.0. Use + * entity_create('field_entity', $field_definition)->save(). + * * See: @link field Field API data structures @endlink. */ function field_create_field(array $field) { @@ -83,6 +86,9 @@ function field_create_field(array $field) { * * @throws Drupal\field\FieldException * + * @deprecated as of Drupal 8.0. Use + * $field->save(). + * * @see field_create_field() */ function field_update_field($field) { @@ -214,6 +220,9 @@ function field_read_fields($conditions = array(), $include_additional = array()) * * @param $field_name * The field name to delete. + * + * @deprecated as of Drupal 8.0. Use + * $field->delete(). */ function field_delete_field($field_name) { if ($field = field_info_field($field_name)) { @@ -244,6 +253,9 @@ function field_delete_field($field_name) { * * @throws Drupal\field\FieldException * + * @deprecated as of Drupal 8.0. Use + * entity_create('field_instance', $instance_definition)->save(). + * * See: @link field Field API data structures @endlink. */ function field_create_instance(array $instance) { @@ -268,6 +280,9 @@ function field_create_instance(array $instance) { * * @throws Drupal\field\FieldException * + * @deprecated as of Drupal 8.0. Use + * $instance->save(). + * * @see field_create_instance() */ function field_update_instance($instance) { @@ -426,6 +441,9 @@ function field_read_instances($conditions = array(), $include_additional = array * If TRUE, the field will be deleted as well if its last instance is being * deleted. If FALSE, it is the caller's responsibility to handle the case of * fields left without instances. Defaults to TRUE. + * + * @deprecated as of Drupal 8.0. Use + * $instance->delete(). */ function field_delete_instance(FieldInstance $instance, $field_cleanup = TRUE) { $instance->delete($field_cleanup);