Révision a192dc0b
Ajouté par Assos Assos il y a environ 8 ans
drupal7/sites/all/modules/feeds/plugins/FeedsNodeProcessor.inc | ||
---|---|---|
36 | 36 |
* Creates a new node in memory and returns it. |
37 | 37 |
*/ |
38 | 38 |
protected function newEntity(FeedsSource $source) { |
39 |
$node = new stdClass();
|
|
39 |
$node = parent::newEntity($source);
|
|
40 | 40 |
$node->type = $this->bundle(); |
41 | 41 |
$node->changed = REQUEST_TIME; |
42 | 42 |
$node->created = REQUEST_TIME; |
43 |
$node->language = LANGUAGE_NONE; |
|
44 | 43 |
$node->is_new = TRUE; |
45 | 44 |
node_object_prepare($node); |
46 | 45 |
// Populate properties that are set by node_object_prepare(). |
... | ... | |
127 | 126 |
* Validates a node. |
128 | 127 |
*/ |
129 | 128 |
protected function entityValidate($entity) { |
129 |
parent::entityValidate($entity); |
|
130 |
|
|
130 | 131 |
if (!isset($entity->uid) || !is_numeric($entity->uid)) { |
131 | 132 |
$entity->uid = $this->config['author']; |
132 | 133 |
} |
... | ... | |
238 | 239 |
case 'created': |
239 | 240 |
$target_node->created = feeds_to_unixtime($value, REQUEST_TIME); |
240 | 241 |
break; |
242 |
case 'changed': |
|
243 |
// The 'changed' value will be set on the node in feeds_node_presave(). |
|
244 |
// This is because node_save() always overwrites this value (though |
|
245 |
// before invoking hook_node_presave()). |
|
246 |
$target_node->feeds_item->node_changed = feeds_to_unixtime($value, REQUEST_TIME); |
|
247 |
break; |
|
241 | 248 |
case 'feeds_source': |
242 | 249 |
// Get the class of the feed node importer's fetcher and set the source |
243 | 250 |
// property. See feeds_node_update() how $node->feeds gets stored. |
... | ... | |
304 | 311 |
'name' => t('Published date'), |
305 | 312 |
'description' => t('The UNIX time when a node has been published.'), |
306 | 313 |
); |
314 |
$targets['changed'] = array( |
|
315 |
'name' => t('Updated date'), |
|
316 |
'description' => t('The Unix timestamp when a node has been last updated.'), |
|
317 |
); |
|
307 | 318 |
$targets['promote'] = array( |
308 | 319 |
'name' => t('Promoted to front page'), |
309 | 320 |
'description' => t('Boolean value, whether or not node is promoted to front page. (1 = promoted, 0 = not promoted)'), |
Formats disponibles : Unified diff
Weekly update of contrib modules