You are here

function hook_realistic_dummy_content_attribute_manipulator_alter in Realistic Dummy Content 3.x

Same name and namespace in other branches
  1. 8.2 api/realistic_dummy_content_api.api.php \hook_realistic_dummy_content_attribute_manipulator_alter()
  2. 8 api/realistic_dummy_content_api.api.php \hook_realistic_dummy_content_attribute_manipulator_alter()
  3. 7.2 api/realistic_dummy_content_api.api.php \hook_realistic_dummy_content_attribute_manipulator_alter()
  4. 7 api/realistic_dummy_content_api.api.php \hook_realistic_dummy_content_attribute_manipulator_alter()

Returns a manipulator class name for a given field.


string $class: A class name to alter.

array $info: More information which may be required for the manipulator class. This can contain [ machine_name => The machine name of a field type. entity => Drupal entity object, field_name => the field name ], which can be required for example to determine which type of entity reference manipulator to create.

1 function implements hook_realistic_dummy_content_attribute_manipulator_alter()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

realistic_dummy_content_api_realistic_dummy_content_attribute_manipulator_alter in api/realistic_dummy_content_api.module
Implements hook_realistic_dummy_content_attribute_manipulator_alter().
1 invocation of hook_realistic_dummy_content_attribute_manipulator_alter()
RealisticDummyContentFieldModifier::addModifier in api/src/includes/RealisticDummyContentFieldModifier.php
Adds a modifier to a list of attribute modifiers.


api/realistic_dummy_content_api.api.php, line 27
Hook definitions for documentation purposes.


function hook_realistic_dummy_content_attribute_manipulator_alter(&$class, array &$info) {

  // If you want to implement a particular manipulator class for a field or
  // property you can do so by implementing this hook and reproducing what's
  // below for your own field or property type.
  switch (Framework::instance()
    ->fieldTypeMachineName($info)) {
    case 'text_with_summary':

      // For example the body.
      $class = '\\Drupal\\realistic_dummy_content_api\\includes\\RealisticDummyContentTextWithSummaryField';
    case 'taxonomy_term_reference':

      // For example, tags on articles.
      $class = '\\Drupal\\realistic_dummy_content_api\\includes\\RealisticDummyContentTermReferenceField';
    case 'image':

      // For example, images on articles.
      $class = '\\Drupal\\realistic_dummy_content_api\\includes\\RealisticDummyContentImageField';