ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
class.ilCertificateDownloadValidator.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2018 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
12 {
17 
22 
27  public function __construct(
30  ) {
31  if (null === $userCertificateAccessValidator) {
33  }
34  $this->userCertificateAccessValidator = $userCertificateAccessValidator;
35 
36  if (null === $activeValidator) {
38  }
39  $this->activeValidator = $activeValidator;
40  }
41 
47  public function isCertificateDownloadable(int $userId, int $objId)
48  {
49  if (false === $this->activeValidator->validate()) {
50  return false;
51  }
52 
53  return $this->userCertificateAccessValidator->validate($userId, $objId);
54  }
55 }
__construct(ilCertificateUserCertificateAccessValidator $userCertificateAccessValidator=null, ilCertificateActiveValidator $activeValidator=null)
Validates if an active certificate is stored in the database and can be downloaded by the user...