Drupal 8  8.0.2
MachineName Class Reference
Inheritance diagram for MachineName:

Public Member Functions

 __construct (array $configuration, $plugin_id, $plugin_definition, TransliterationInterface $transliteration)
 
 transform ($value, MigrateExecutableInterface $migrate_executable, Row $row, $destination_property)
 
- Public Member Functions inherited from ProcessPluginBase
 transform ($value, MigrateExecutableInterface $migrate_executable, Row $row, $destination_property)
 
 multiple ()
 
- Public Member Functions inherited from PluginInspectionInterface
 getPluginId ()
 
 getPluginDefinition ()
 

Static Public Member Functions

static create (ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition)
 

Protected Attributes

 $transliteration
 

Detailed Description

This plugin creates a machine name.

The current value gets transliterated, non-alphanumeric characters removed and replaced by an underscore and multiple underscores are collapsed into one.

( id = "machine_name" )

Constructor & Destructor Documentation

__construct ( array  $configuration,
  $plugin_id,
  $plugin_definition,
TransliterationInterface  $transliteration 
)

Constructs a MachineName plugin.

Parameters
array$configurationThe plugin configuration.
string$plugin_idThe plugin ID.
mixed$plugin_definitionThe plugin definition.
\Drupal\Component\Transliteration\TransliterationInterface$transliterationThe transliteration service.

References Drupal\transliteration().

Here is the call graph for this function:

Member Function Documentation

static create ( ContainerInterface  $container,
array  $configuration,
  $plugin_id,
  $plugin_definition 
)
static

{Creates an instance of the plugin.

Parameters
\Symfony\Component\DependencyInjection\ContainerInterface$containerThe container to pull out services used in the plugin.
array$configurationA configuration array containing information about the plugin instance.
string$plugin_idThe plugin ID for the plugin instance.
mixed$plugin_definitionThe plugin implementation definition.
Returns
static Returns an instance of this plugin.
}

Implements ContainerFactoryPluginInterface.

transform (   $value,
MigrateExecutableInterface  $migrate_executable,
Row  $row,
  $destination_property 
)

{Performs the associated process.

Parameters
mixed$valueThe value to be transformed.
\Drupal\migrate\MigrateExecutableInterface$migrate_executableThe migration in which this process is being executed.
\Drupal\migrate\Row$rowThe row from the source to process. Normally, just transforming the value is adequate but very rarely you might need to change two columns at the same time or something like that.
string$destination_propertyThe destination property currently worked on. This is only used together with the $row above.
Returns
string|array The newly transformed value.
}

Implements MigrateProcessInterface.

References LanguageInterface\LANGCODE_DEFAULT, and Drupal\transliteration().

Here is the call graph for this function:


The documentation for this class was generated from the following file: