Advertisement
Guest User

Untitled

a guest
Dec 8th, 2016
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. $node = DrupalnodeEntityNode::create([
  2. 'type' => 'issue',
  3. 'title' => $title,
  4. 'body' => $body,
  5. 'field_issue_category' => $term,
  6. 'field_issue_type' => 'publication',
  7. 'field_pub_id' => [
  8. 'target_id' => $publication_id,
  9. ],
  10. 'field_issue_group' => $group_id,
  11. 'field_date' => $date,
  12. ]);
  13. $node->save();
  14.  
  15. $nid = $node->id();
  16. $title = preg_replace("/[s_]/", "-", $title);
  17. $path = Drupal::service('path.alias_storage')->save('/node/'.$nid, '/mypath/'.$title);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement