class MigrateLinkFieldHandler in Link 6.2
Same name and namespace in other branches
- 7 link.migrate.inc \MigrateLinkFieldHandler
@file Support for migrate module
Hierarchy
- class \MigrateHandler
- class \MigrateFieldHandler
- class \MigrateLinkFieldHandler
- class \MigrateFieldHandler
Expanded class hierarchy of MigrateLinkFieldHandler
File
- ./
link.migrate.inc, line 7 - Support for migrate module
View source
class MigrateLinkFieldHandler extends MigrateFieldHandler {
public function __construct() {
$this
->registerTypes(array(
'link',
));
}
static function arguments($title = NULL, $attributes = NULL, $language = NULL) {
$arguments = array();
if (!is_null($title)) {
$arguments['title'] = $title;
}
if (!is_null($attributes)) {
$arguments['attributes'] = $attributes;
}
if (!is_null($language)) {
$arguments['language'] = $language;
}
return $arguments;
}
public function prepare($entity, array $instance, array $values) {
if (isset($values['arguments'])) {
$arguments = $values['arguments'];
unset($values['arguments']);
}
else {
$arguments = array();
}
$delta = 0;
foreach ($values as $value) {
$item = array();
if (isset($arguments['title'])) {
$item['title'] = $arguments['title'];
}
if (isset($arguments['attributes'])) {
$item['attributes'] = $arguments['attributes'];
}
$item['url'] = $value;
$return[$delta] = $item;
$delta++;
}
return isset($return) ? $return : NULL;
}
}
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 | |
MigrateLinkFieldHandler:: |
static | function | ||
MigrateLinkFieldHandler:: |
public | function | ||
MigrateLinkFieldHandler:: |
public | function |
Overrides MigrateHandler:: |