You are here

public static function LPStatus::getCertificateExpirationPeriod in Opigno Learning path 3.x

Same name and namespace in other branches
  1. 8 src/Entity/LPStatus.php \Drupal\opigno_learning_path\Entity\LPStatus::getCertificateExpirationPeriod()

Gets training certificate expiration period.

Parameters

\Drupal\group\Entity\Group $group: Group object.

Return value

int|null Training certificate expiration period.

File

src/Entity/LPStatus.php, line 260

Class

LPStatus
Defines the User Learning Path attempt status entity.

Namespace

Drupal\opigno_learning_path\Entity

Code

public static function getCertificateExpirationPeriod(Group $group) {
  $value = $group
    ->get('field_certificate_expire_results')
    ->getValue();
  if (empty($value)) {
    return NULL;
  }
  return (int) $value[0]['value'];
}