ILIAS  trunk Revision v11.0_alpha-2662-g519ff7d528f
ILIAS\Repository\Ownership\OwnershipManagementRetrieval Class Reference
+ Inheritance diagram for ILIAS\Repository\Ownership\OwnershipManagementRetrieval:
+ Collaboration diagram for ILIAS\Repository\Ownership\OwnershipManagementRetrieval:

Public Member Functions

 __construct (protected InternalDomainService $domain, protected int $user_id, protected array $objects, protected string $selected_type)
 
 setData (array $objects, string $selected_type)
 
 isFieldNumeric (string $field)
 
 getData (array $fields, ?Range $range=null, ?Order $order=null, array $filter=[], array $parameters=[])
 
 count (array $filter, array $parameters)
 

Protected Member Functions

 buildPath (int $ref_id)
 

Protected Attributes

array $data = []
 

Detailed Description

Definition at line 29 of file OwnershipManagementRetrieval.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Repository\Ownership\OwnershipManagementRetrieval::__construct ( protected InternalDomainService  $domain,
protected int  $user_id,
protected array  $objects,
protected string  $selected_type 
)

Definition at line 35 of file OwnershipManagementRetrieval.php.

References ILIAS\Repository\Ownership\OwnershipManagementRetrieval\setData().

40  {
41  $this->setData($this->objects, $this->selected_type);
42  }
+ Here is the call graph for this function:

Member Function Documentation

◆ buildPath()

ILIAS\Repository\Ownership\OwnershipManagementRetrieval::buildPath ( int  $ref_id)
protected

Definition at line 98 of file OwnershipManagementRetrieval.php.

References $path, and ILIAS\Repository\Ownership\OwnershipManagementRetrieval\count().

Referenced by ILIAS\Repository\Ownership\OwnershipManagementRetrieval\setData().

98  : string
99  {
100  $tree = $this->domain->repositoryTree();
101  $path = '...';
102  $counter = 0;
103  $path_full = $tree->getPathFull($ref_id);
104  foreach ($path_full as $data) {
105  if (++$counter < (count($path_full) - 2)) {
106  continue;
107  }
108  if ($ref_id != $data['ref_id']) {
109  $path .= ' &raquo; ' . $data['title'];
110  }
111  }
112 
113  return $path;
114  }
$path
Definition: ltiservices.php:29
$ref_id
Definition: ltiauth.php:65
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ count()

ILIAS\Repository\Ownership\OwnershipManagementRetrieval::count ( array  $filter,
array  $parameters 
)

Implements ILIAS\Repository\RetrievalInterface.

Definition at line 133 of file OwnershipManagementRetrieval.php.

Referenced by ILIAS\Repository\Ownership\OwnershipManagementRetrieval\buildPath().

133  : int
134  {
135  return count($this->data);
136  }
+ Here is the caller graph for this function:

◆ getData()

ILIAS\Repository\Ownership\OwnershipManagementRetrieval::getData ( array  $fields,
?Range  $range = null,
?Order  $order = null,
array  $filter = [],
array  $parameters = [] 
)

Implements ILIAS\Repository\RetrievalInterface.

Definition at line 116 of file OwnershipManagementRetrieval.php.

References ILIAS\Repository\Ownership\OwnershipManagementRetrieval\$data, and ILIAS\UI\Implementation\Component\Table\$range.

122  : \Generator {
123  $data = $this->data;
124 
125  $data = $this->applyOrder($data, $order);
126  $data = $this->applyRange($data, $range);
127 
128  foreach ($data as $row) {
129  yield $row;
130  }
131  }

◆ isFieldNumeric()

ILIAS\Repository\Ownership\OwnershipManagementRetrieval::isFieldNumeric ( string  $field)

Implements ILIAS\Repository\RetrievalInterface.

Definition at line 92 of file OwnershipManagementRetrieval.php.

92  : bool
93  {
94  return in_array($field, ['id', 'obj_id', 'ref_id']);
95  }

◆ setData()

ILIAS\Repository\Ownership\OwnershipManagementRetrieval::setData ( array  $objects,
string  $selected_type 
)

Definition at line 44 of file OwnershipManagementRetrieval.php.

References $id, $ref_id, ilObject\_getAllReferences(), ilObject\_lookupType(), ILIAS\Repository\Ownership\OwnershipManagementRetrieval\buildPath(), and SYSTEM_FOLDER_ID.

Referenced by ILIAS\Repository\Ownership\OwnershipManagementRetrieval\__construct().

44  : void
45  {
46  $access = $this->domain->access();
47  $tree = $this->domain->repositoryTree();
48  $is_admin = false;
49  $a_type = '';
50 
51  if (!$this->user_id) {
52  $is_admin = $access->checkAccess('visible', '', SYSTEM_FOLDER_ID);
53  }
54 
55  $this->data = [];
56  if (empty($objects[$selected_type])) {
57  return;
58  }
59 
60  foreach ($objects[$selected_type] as $id => $item) {
62  if ($refs) {
63  foreach ($refs as $ref_id) {
64  if (!$tree->isDeleted($ref_id)) {
65  if ($this->user_id) {
66  $readable = $access->checkAccessOfUser(
67  $this->user_id,
68  'read',
69  '',
70  $ref_id,
71  $a_type
72  );
73  } else {
74  $readable = $is_admin;
75  }
76 
77  $this->data[] = [
78  'obj_id' => $id,
79  'ref_id' => $ref_id,
80  'id' => $ref_id,
81  'type' => \ilObject::_lookupType($id),
82  'title' => $item,
83  'path' => $this->buildPath($ref_id),
84  'readable' => $readable
85  ];
86  }
87  }
88  }
89  }
90  }
static _getAllReferences(int $id)
get all reference ids for object ID
const SYSTEM_FOLDER_ID
Definition: constants.php:35
$ref_id
Definition: ltiauth.php:65
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
static _lookupType(int $id, bool $reference=false)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $data

array ILIAS\Repository\Ownership\OwnershipManagementRetrieval::$data = []
protected

The documentation for this class was generated from the following file: