ILIAS  release_7 Revision v7.30-3-g800a261c036
class.ilCertificateUserCertificateAccessValidator.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2019 ILIAS open source, Extended GPL, see docs/LICENSE */
3
8{
13
19 {
20 if (null === $userCertificateRepository) {
21 global $DIC;
22 $database = $DIC->database();
23 $logger = $DIC->logger()->cert();
24
26 }
27 $this->userCertificateRepository = $userCertificateRepository;
28 }
29
35 public function validate(int $userId, int $objId)
36 {
37 try {
38 $this->userCertificateRepository->fetchActiveCertificate($userId, $objId);
39 } catch (ilException $exception) {
40 return false;
41 }
42
43 return true;
44 }
45}
An exception for terminatinating execution or to throw for unit testing.
__construct(ilUserCertificateRepository $userCertificateRepository=null)
ilCertificateHasUserCertificateValidator constructor.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
global $DIC
Definition: goto.php:24
$objId
Definition: xapitoken.php:39