Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $vids = Drupal::entityManager()->getStorage('node')->revisionIds($node);
- // Note: sorted ascending by revision id.
- foreach ($vids as $i=>$vid) {
- if ($revision = node_revision_load($vid)) {
- $recentValues[] = $revision->FIELD_MACHINE_NAME->value;
- }
- if($i==1) break; // if you want two recent i=0 , i=1
- }
- kint($recentValues);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement