Add the agaric_migration module

This commit is contained in:
David Valdez 2018-08-22 12:50:20 -05:00 committed by benjamin melançon
parent e38187bc7d
commit 331e22299a
4 changed files with 89 additions and 0 deletions

View file

@ -0,0 +1,36 @@
<?php
namespace Drupal\agaric_migration\Plugin\migrate\process;
use Drupal\migrate_plus\Plugin\migrate\process\EntityGenerate;
/**
* RoleGenerate migrate plugin.
*
* Basically just extends the EntityGenerate module and overwrite the entity
* method and there just set a label to the role.
*
* @MigrateProcessPlugin(
* id = "role_generate"
* )
*
* @see EntityGenerate
*/
class RoleGenerate extends EntityGenerate {
/**
* Gives a proper label to the role.
*
* @param mixed $value
* Primary value to use in creation of the entity.
*
* @return array
* Entity value array.
*/
protected function entity($value) {
$entity_values = parent::entity($value);
$entity_values['label'] = ucfirst($value);
return $entity_values;
}
}