Advertisement
Guest User

Untitled

a guest
Jan 16th, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. $vids = Drupal::entityManager()->getStorage('node')->revisionIds($node);
  2. // Note: sorted ascending by revision id.
  3. foreach ($vids as $i=>$vid) {
  4. if ($revision = node_revision_load($vid)) {
  5. $recentValues[] = $revision->FIELD_MACHINE_NAME->value;
  6. }
  7. if($i==1) break; // if you want two recent i=0 , i=1
  8. }
  9.  
  10. kint($recentValues);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement