I'm trying to access the comment field value in controller. With the following code I'm able to access the particular comment object.
$comment = \Drupal::entityManager()->getStorage('comment')->load($commentID);
I understand I cannot access the values by traversing the object since the values are protected. I tried
$comment->get('subject')->value function, this time its looping and doesn't return any results.
How do I achieve retrieving the value of specific fields associated with comment entity?