Use annotation when you have call to undefined method get();

PHOTO EMBED

Tue Dec 07 2021 12:05:34 GMT+0000 (UTC)

Saved by @igor #drupal

    /** @var \Drupal\bacademy_cpd\Entity\CpdPoints $cpd_record */
    foreach ($cpd_records as $cpd_record) {
      $completed_node = $cpd_record->get('node')->entity;
      /** @var \Drupal\node\Entity\Node $completed_node */
      $completed_nodeID = $completed_node->get('nid')->value;
content_copyCOPY