ILIAS  release_8 Revision v8.24
Readable.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
21namespace ILIAS\Modules\Test;
22
23use Closure;
25use ilObject;
26
28{
31 private Closure $references_of;
33
34 public function __construct(
36 $references_of = [ilObject::class, '_getAllReferences'],
37 Incident $incident = null
38 ) {
39 $this->container = $container;
40 $this->references_of = Closure::fromCallable($references_of);
41 $this->incident = $incident ?? new Incident();
42 }
43
47 public function references(array $references): bool
48 {
49 return $this->incident->any(fn (int $ref_id): bool => (
50 $this->container->access()->checkAccess('read', '', $ref_id)
51 ), $references);
52 }
53
54 public function objectId(int $obj_id): bool
55 {
56 return $this->references(($this->references_of)($obj_id));
57 }
58}
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:32
__construct(Container $container, $references_of=[ilObject::class, '_getAllReferences'], Incident $incident=null)
Definition: Readable.php:34
references(array $references)
Definition: Readable.php:47
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$ref_id
Definition: ltiauth.php:67