Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
feeds
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
drupal.org
feeds
Commits
56e4fb2b
Commit
56e4fb2b
authored
12 years ago
by
Chris Leppanen
Browse files
Options
Downloads
Patches
Plain Diff
git commit -m Issue
parent
189015f6
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
feeds.api.php
+25
-0
25 additions, 0 deletions
feeds.api.php
plugins/FeedsProcessor.inc
+4
-0
4 additions, 0 deletions
plugins/FeedsProcessor.inc
with
29 additions
and
0 deletions
feeds.api.php
+
25
−
0
View file @
56e4fb2b
...
...
@@ -124,6 +124,31 @@ function hook_feeds_before_import(FeedsSource $source) {
// See feeds_rules module's implementation for an example.
}
/**
* Invoked after a feed item has been saved.
*
* @param $source
* FeedsSource object that describes the source that is being imported.
* @param $entity
* The entity object that has just been saved.
* @param $item
* The parser result for this entity.
*/
function
hook_feeds_after_save
(
FeedsSource
$source
,
$entity
,
$item
)
{
// Use $entity->nid of the saved node.
// Although the $entity object is passed by reference, any changes made in
// this function will be ignored by the FeedsProcessor.
$config
=
$source
->
importer
()
->
getConfig
();
if
(
$config
[
'processor'
][
'config'
][
'purge_unseen_items'
]
&&
isset
(
$entity
->
feeds_item
))
{
$feeds_item
=
$entity
->
feeds_item
;
$feeds_item
->
batch_id
=
feeds_delete_get_current_batch
(
$feeds_item
->
feed_nid
);
drupal_write_record
(
'feeds_delete_item'
,
$feeds_item
);
}
}
/**
* Invoked after a feed source has been imported.
*
...
...
This diff is collapsed.
Click to expand it.
plugins/FeedsProcessor.inc
+
4
−
0
View file @
56e4fb2b
...
...
@@ -235,6 +235,10 @@ abstract class FeedsProcessor extends FeedsPlugin {
$this
->
entitySaveAccess
(
$entity
);
$this
->
entitySave
(
$entity
);
// Allow modules to perform operations using the saved entity data.
// $entity contains the updated entity after saving.
module_invoke_all
(
'feeds_after_save'
,
$source
,
$entity
,
$item
);
// Track progress.
if
(
empty
(
$entity_id
))
{
$state
->
created
++
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment