ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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 (?array $filter_data, ?array $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 58 of file DataRetrieval.php.

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 }
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(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 }
Both the subject and the direction need to be specified when expressing an order.
Definition: Order.php:29
buildOrderingRow(string $id, array $record)

References ILIAS\UI\Component\Table\OrderingRowBuilder\buildOrderingRow(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ getTotalRowCount()

ILIAS\Bibliographic\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\Bibliographic\Field\DataRetrieval::$lng
private

Definition at line 31 of file DataRetrieval.php.


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