You are here

public function OpignoModule::getKeepResultsOption in Opigno module 3.x

Same name and namespace in other branches
  1. 8 src/Entity/OpignoModule.php \Drupal\opigno_module\Entity\OpignoModule::getKeepResultsOption()

Get option to know which result need to be saved on Database.

Return value

string Return string "best", "newest" or "all"

1 call to OpignoModule::getKeepResultsOption()
OpignoModule::getUserScore in src/Entity/OpignoModule.php
Implements opigno_module_get_user_module_score().

File

src/Entity/OpignoModule.php, line 797

Class

OpignoModule
Defines the Module entity.

Namespace

Drupal\opigno_module\Entity

Code

public function getKeepResultsOption() {
  $keep_results_options = [
    0 => 'best',
    1 => 'newest',
    2 => 'all',
  ];
  $option = $this
    ->get('keep_results')->value;
  return $keep_results_options[$option];
}