You are here

public function OpignoActivity::getAnswers in Opigno module 8

Same name and namespace in other branches
  1. 3.x src/Entity/OpignoActivity.php \Drupal\opigno_module\Entity\OpignoActivity::getAnswers()

File

src/Entity/OpignoActivity.php, line 275

Class

OpignoActivity
Defines the Activity entity.

Namespace

Drupal\opigno_module\Entity

Code

public function getAnswers($return_entities_array = NULL) {
  $answer_storage = static::entityTypeManager()
    ->getStorage('opigno_answer');
  $query = $answer_storage
    ->getQuery();
  $aids = $query
    ->condition('activity', $this
    ->id())
    ->execute();
  if ($return_entities_array) {
    return $answer_storage
      ->loadMultiple($aids);
  }
  return $aids;
}