Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
drupal.org
email
Commits
b6ac2efe
Commit
b6ac2efe
authored
Sep 29, 2011
by
Matthias Hutterer
Browse files
Issue #1232028 by Bevan, das-peter: Added support for Migrate package.
parent
0d8b622d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
0 deletions
+32
-0
email.info
email.info
+1
-0
email.migrate.inc
email.migrate.inc
+24
-0
email.module
email.module
+7
-0
No files found.
email.info
View file @
b6ac2efe
...
...
@@ -5,3 +5,4 @@ package = Fields
files
[]
=
email
.
module
files
[]
=
email
.
install
files
[]
=
email
.
migrate
.
inc
email.migrate.inc
0 → 100644
View file @
b6ac2efe
<?php
/**
* @file
* Support for the Migrate package.
*/
class
MigrateEmailFieldHandler
extends
MigrateFieldHandler
{
public
function
__construct
()
{
$this
->
registerTypes
(
array
(
'email'
));
}
public
function
prepare
(
stdClass
$entity
,
array
$field_info
,
array
$instance
,
array
$values
)
{
// Setup the Field API array for saving.
$arguments
=
(
isset
(
$values
[
'arguments'
]))
?
$values
[
'arguments'
]
:
array
();
$language
=
$this
->
getFieldLanguage
(
$entity
,
$field_info
,
$arguments
);
$delta
=
0
;
foreach
(
$values
as
$value
)
{
$return
[
$language
][
$delta
][
'email'
]
=
$value
;
$delta
++
;
}
return
isset
(
$return
)
?
$return
:
NULL
;
}
}
email.module
View file @
b6ac2efe
...
...
@@ -16,6 +16,13 @@ function email_field_info() {
);
}
/**
* Implements hook_migrate_api().
*/
function
email_migrate_api
()
{
return
array
(
'api'
=>
2
);
}
/**
* Implements hook_field_validate().
*
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment