ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
ILIAS\components\Database\Integrity\Field\DataRetrieval Class Reference

Class DataRetrieval. More...

+ Inheritance diagram for ILIAS\components\Database\Integrity\Field\DataRetrieval:
+ Collaboration diagram for ILIAS\components\Database\Integrity\Field\DataRetrieval:

Public Member Functions

 __construct (protected \ilBiblAdminFactoryFacadeInterface $facade, private bool $has_write_access)
 
 getRows (OrderingRowBuilder $row_builder, array $visible_column_ids)
 
 getTotalRowCount (?array $filter_data, ?array $additional_parameters)
 

Protected Member Functions

 getRecords (Order $order)
 

Private Attributes

ilLanguage $lng
 

Detailed Description

Class DataRetrieval.

Definition at line 29 of file DataRetrieval.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\components\Database\Integrity\Field\DataRetrieval::__construct ( protected \ilBiblAdminFactoryFacadeInterface  $facade,
private bool  $has_write_access 
)

Definition at line 33 of file DataRetrieval.php.

References $DIC, and ILIAS\Repository\lng().

36  {
37  global $DIC;
38  $this->lng = $DIC['lng'];
39  }
global $DIC
Definition: shib_login.php:26
+ Here is the call graph for this function:

Member Function Documentation

◆ getRecords()

ILIAS\components\Database\Integrity\Field\DataRetrieval::getRecords ( Order  $order)
protected

Definition at line 58 of file DataRetrieval.php.

References Vendor\Package\$a, Vendor\Package\$b, and ILIAS\Data\Order\join().

Referenced by ILIAS\components\Database\Integrity\Field\DataRetrieval\getRows().

58  : array
59  {
60  $records = $this->facade->fieldFactory()->filterAllFieldsForTypeAsArray($this->facade->type());
61  [$order_field, $order_direction] = $order->join([], fn($ret, $key, $value): array => [$key, $value]);
62  usort($records, fn($a, $b): int => $a[$order_field] <=> $b[$order_field]);
63  if ($order_direction === 'DESC') {
64  return array_reverse($records);
65  }
66  return $records;
67  }
$a
thx to https://mlocati.github.io/php-cs-fixer-configurator for the examples
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getRows()

ILIAS\components\Database\Integrity\Field\DataRetrieval::getRows ( OrderingRowBuilder  $row_builder,
array  $visible_column_ids 
)

Definition at line 41 of file DataRetrieval.php.

References ILIAS\components\Database\Integrity\Field\DataRetrieval\getRecords(), and ILIAS\Repository\lng().

44  : \Generator {
45  $records = $this->getRecords(new Order('position', 'ASC'));
46  foreach ($records as $record) {
47  $row_id = (string) $record['id'];
48  $field = $this->facade->fieldFactory()->findById($record['id']);
49  $record['data_type'] = $this->facade->translationFactory()->translate($field);
50  $record['is_standard_field'] = $field->isStandardField() ? $this->lng->txt('standard') : $this->lng->txt(
51  'custom'
52  );
53  yield $row_builder->buildOrderingRow($row_id, $record)
54  ->withDisabledAction('translate', !$this->has_write_access);
55  }
56  }
+ Here is the call graph for this function:

◆ getTotalRowCount()

ILIAS\components\Database\Integrity\Field\DataRetrieval::getTotalRowCount ( ?array  $filter_data,
?array  $additional_parameters 
)

Definition at line 69 of file DataRetrieval.php.

72  : ?int {
73  return count($this->facade->fieldFactory()->getAvailableFieldsForObjId($this->facade->iliasObjId()));
74  }

Field Documentation

◆ $lng

ilLanguage ILIAS\components\Database\Integrity\Field\DataRetrieval::$lng
private

Definition at line 31 of file DataRetrieval.php.


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