class MigrateNodewordsNodeHandler in Migrate Extras 6.2
@file Support for importing META information into the Nodewords module.
Hierarchy
- class \MigrateHandler
- class \MigrateDestinationHandler
- class \MigrateNodewordsNodeHandler
- class \MigrateDestinationHandler
Expanded class hierarchy of MigrateNodewordsNodeHandler
1 string reference to 'MigrateNodewordsNodeHandler'
File
- ./
nodewords.inc, line 8 - Support for importing META information into the Nodewords module.
View source
class MigrateNodewordsNodeHandler extends MigrateDestinationHandler {
public function __construct() {
$this
->registerTypes(array(
'node',
));
}
/**
* Make the destination fields visible. Prefixes added to avoid potential
* conflict with other modules.
*/
public function fields() {
if (module_exists('nodewords')) {
return array(
'nodewords_abstract' => t('Nodewords: Abstract'),
'nodewords_canonical' => t('Nodewords: Canonical'),
'nodewords_copyright' => t('Nodewords: Copyright'),
'nodewords_description' => t('Nodewords: Description'),
'nodewords_keywords' => t('Nodewords: Keywords'),
'nodewords_revisit-after' => t('Nodewords: Revisit After'),
'nodewords_robots' => t('Nodewords: Robots'),
);
}
else {
return array();
}
}
/**
* Move the nodewords fields into the appropriate structure for the nodewords
* module to handle them on update/insert.
*/
public function prepare($node, stdClass $row) {
if (module_exists('nodewords')) {
foreach ($this
->fields() as $full_field => $label) {
if (isset($node->{$full_field})) {
$field = substr($full_field, strlen('nodewords_'));
$node->nodewords[$field]['value'] = $node->{$full_field};
unset($node->{$full_field});
}
}
}
}
}
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? | |
MigrateHandler:: |
protected | function | Register a list of types handled by this class | |
MigrateNodewordsNodeHandler:: |
public | function | Make the destination fields visible. Prefixes added to avoid potential conflict with other modules. | |
MigrateNodewordsNodeHandler:: |
public | function | Move the nodewords fields into the appropriate structure for the nodewords module to handle them on update/insert. | |
MigrateNodewordsNodeHandler:: |
public | function |
Overrides MigrateHandler:: |