class PathautoMigrationHandler in Pathauto 7
Field handler.
Hierarchy
- class \MigrateHandler
- class \MigrateDestinationHandler
- class \PathautoMigrationHandler
- class \MigrateDestinationHandler
Expanded class hierarchy of PathautoMigrationHandler
1 string reference to 'PathautoMigrationHandler'
File
- ./
pathauto.migrate.inc, line 11 - Support for the Pathauto module.
View source
class PathautoMigrationHandler extends MigrateDestinationHandler {
public function __construct() {
$this
->registerTypes(array(
'entity',
));
}
/**
* Make the destination field visible.
*/
public function fields() {
return array(
'pathauto' => t('Pathauto: Perform aliasing (set to 0 to prevent alias generation during migration'),
);
}
public function prepare($entity, stdClass $row) {
if (isset($entity->pathauto)) {
if (!isset($entity->path)) {
$entity->path = array();
}
elseif (is_string($entity->path)) {
// If MigratePathEntityHandler->prepare() hasn't run yet, support
// the alias (set as $entity->path as a string) being formatted properly
// in the path alias array.
$path = $entity->path;
$entity->path = array();
$entity->path['alias'] = $path;
}
$entity->path['pathauto'] = $entity->pathauto;
if (!isset($entity->path['alias'])) {
$entity->path['alias'] = '';
}
unset($entity->pathauto);
}
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
MigrateHandler:: |
protected | property | List of other handler classes which should be invoked before the current one. | |
MigrateHandler:: |
protected | property | List of "types" handled by this handler. Depending on the kind of handler, these may be destination types, field types, etc. | |
MigrateHandler:: |
public | function | ||
MigrateHandler:: |
public | function | ||
MigrateHandler:: |
public | function | Does this handler handle the given type? | 1 |
MigrateHandler:: |
protected | function | Register a list of types handled by this class | |
PathautoMigrationHandler:: |
public | function | Make the destination field visible. | |
PathautoMigrationHandler:: |
public | function | ||
PathautoMigrationHandler:: |
public | function |
Overrides MigrateHandler:: |