setItemsPerPage(0); } public function summaryTitle() { if (!empty($this->options['offset'])) { return $this->t('All items, skip @skip', ['@skip' => $this->options['offset']]); } return $this->t('All items'); } protected function defineOptions() { $options = parent::defineOptions(); $options['offset'] = ['default' => 0]; return $options; } /** * Provide the default form for setting options. */ public function buildOptionsForm(&$form, FormStateInterface $form_state) { parent::buildOptionsForm($form, $form_state); $form['offset'] = [ '#type' => 'textfield', '#title' => $this->t('Offset (number of items to skip)'), '#description' => $this->t('For example, set this to 3 and the first 3 items will not be displayed.'), '#default_value' => $this->options['offset'], ]; } public function usePager() { return FALSE; } public function useCountQuery() { return FALSE; } public function getItemsPerPage() { return 0; } public function executeCountQuery(&$count_query) { // If we are displaying all items, never count. But we can update the count in post_execute. } public function postExecute(&$result) { $this->total_items = count($result); } public function query() { // The only query modifications we might do are offsets. if (!empty($this->options['offset'])) { $this->view->query->setOffset($this->options['offset']); } } }