19declare(strict_types=1);
26use Psr\Http\Message\ServerRequestInterface;
57 ViewControl\
Factory $view_control_factory,
58 ViewControlContainer\
Factory $view_control_container_factory,
59 protected DataFactory $data_factory,
63 protected T\DataRetrieval $data_retrieval,
68 $view_control_factory,
69 $view_control_container_factory,
81 return $this->data_retrieval;
87 $clone->filter = $filter;
99 $clone->additional_parameters = $additional_parameters;
105 return $this->additional_parameters;
110 return $this->data_row_builder
121 ?array $additional_parameters = []
124 $total_count = $this->
getDataRetrieval()->getTotalRowCount($filter_data, $additional_parameters);
128 # This retrieves container data from the request
132 $order =
$data[self::VIEWCONTROL_KEY_ORDERING];
133 $order = ($order instanceof
Order) ? $order :
null;
143 ->withSelectedOptionalColumns(
$data[self::VIEWCONTROL_KEY_FIELDSELECTION] ??
null);
144 # This retrieves the view controls that should be displayed
145 $view_controls = $table->applyValuesToViewcontrols($table->getViewControls($total_count), $request);
154 protected function getViewControls(?
int $total_count =
null): ViewControlContainer\ViewControl
161 $view_controls = array_filter($view_controls);
162 return $this->view_control_container_factory->standard($view_controls);
Both the subject and the direction need to be specified when expressing an order.
A simple class to express a naive range of whole positive numbers.
croppedTo(int $max)
This will create a range that is guaranteed to not exceed $max.
applyValuesToViewcontrols(ViewControlContainer\ViewControl $view_controls, ServerRequestInterface $request)
getAdditionalParameters()
array $additional_parameters
getViewControls(?int $total_count=null)
applyViewControls(array $filter_data, ?array $additional_parameters=[])
const VIEWCONTROL_KEY_FIELDSELECTION
const VIEWCONTROL_KEY_PAGINATION
withFilter(?array $filter)
__construct(SignalGeneratorInterface $signal_generator, ViewControl\Factory $view_control_factory, ViewControlContainer\Factory $view_control_container_factory, protected DataFactory $data_factory, protected DataRowBuilder $data_row_builder, string $title, array $columns, protected T\DataRetrieval $data_retrieval, \ArrayAccess $storage)
const VIEWCONTROL_KEY_ORDERING
withAdditionalParameters(?array $additional_parameters)
Interface to be extended by components that have the possibility to bind to Javascript.
A Column describes the form of presentation for a certain aspect of data, i.e.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
trait TableViewControlPagination
getViewControlPagination(?int $total_count=null)
trait TableViewControlOrdering
getViewControlFieldSelection()
getViewControlOrdering(int|null $total_count)
initViewControlFieldSelection(array $columns)
initViewControlOrdering()
initViewControlpagination()
trait TableViewControlFieldSelection
getViewControls()
@inheritDoc
trait JavaScriptBindable
Trait for components implementing JavaScriptBindable providing standard implementation.