ILIAS  trunk Revision v12.0_alpha-377-g3641b37b9db
ILIAS\Bibliographic\Field\DataRetrieval Class Reference

Class DataRetrieval. More...

+ Inheritance diagram for ILIAS\Bibliographic\Field\DataRetrieval:
+ Collaboration diagram for ILIAS\Bibliographic\Field\DataRetrieval:

Public Member Functions

 __construct (protected \ilBiblAdminFactoryFacadeInterface $facade, private bool $has_write_access)
 
 getRows (OrderingRowBuilder $row_builder, array $visible_column_ids,)
 This is called by the (ordering-)table to retrieve rows; map data-records to rows using the $row_builder e.g. More...
 
 getTotalRowCount (mixed $additional_viewcontrol_data, mixed $filter_data, mixed $additional_parameters)
 
 getRows (OrderingRowBuilder $row_builder, array $visible_column_ids)
 This is called by the (ordering-)table to retrieve rows; map data-records to rows using the $row_builder e.g. More...
 

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\Bibliographic\Field\DataRetrieval::__construct ( protected \ilBiblAdminFactoryFacadeInterface  $facade,
private bool  $has_write_access 
)

Definition at line 33 of file DataRetrieval.php.

36 {
37 global $DIC;
38 $this->lng = $DIC['lng'];
39 }
global $DIC
Definition: shib_login.php:26

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

+ Here is the call graph for this function:

Member Function Documentation

◆ getRecords()

ILIAS\Bibliographic\Field\DataRetrieval::getRecords ( Order  $order)
protected

Definition at line 56 of file DataRetrieval.php.

56 : array
57 {
58 $records = $this->facade->fieldFactory()->filterAllFieldsForTypeAsArray($this->facade->type());
59 [$order_field, $order_direction] = $order->join([], fn($ret, $key, $value): array => [$key, $value]);
60 usort($records, fn($a, $b): int => $a[$order_field] <=> $b[$order_field]);
61 if ($order_direction === 'DESC') {
62 return array_reverse($records);
63 }
64 return $records;
65 }
join($init, callable $fn)
Definition: Order.php:75
$a
thx to https://mlocati.github.io/php-cs-fixer-configurator for the examples

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

+ Here is the call graph for this function:

◆ getRows()

ILIAS\Bibliographic\Field\DataRetrieval::getRows ( OrderingRowBuilder  $row_builder,
array  $visible_column_ids 
)

This is called by the (ordering-)table to retrieve rows; map data-records to rows using the $row_builder e.g.

yield $row_builder->buildOrderingRow($row_id, $record).

Implements ILIAS\UI\Component\Table\OrderingRetrieval.

Definition at line 41 of file DataRetrieval.php.

44 : \Generator {
45 $records = $this->getRecords($order);
46 foreach ($records as $idx => $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('custom');
51 yield $row_builder->buildDataRow($row_id, $record)
52 ->withDisabledAction('translate', !$this->has_write_access);
53 }
54 }

References ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ getTotalRowCount()

ILIAS\Bibliographic\Field\DataRetrieval::getTotalRowCount ( mixed  $additional_viewcontrol_data,
mixed  $filter_data,
mixed  $additional_parameters 
)

Definition at line 67 of file DataRetrieval.php.

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

Field Documentation

◆ $lng

ilLanguage ILIAS\Bibliographic\Field\DataRetrieval::$lng
private

Definition at line 31 of file DataRetrieval.php.


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