postExecute example


    }
  }

  /** * Runs the postExecute() on all active handlers. */
  protected function _postExecute() {
    foreach ($this::getHandlerTypes() as $key => $info) {
      $handlers = &$this->$key;
      foreach ($handlers as $id => $handler) {
        $handlers[$id]->postExecute($this->result);
      }
    }
  }

  /** * Attaches the views handler for the specific type. * * @param string $key * One of 'argument', 'field', 'sort', 'filter', 'relationship'. * @param array $info * An array of views handler types use in the view with additional * information about them. */


        $result = $query->execute();
        $result->setFetchMode(\PDO::FETCH_CLASS, 'Drupal\views\ResultRow');

        // Setup the result row objects.         $view->result = iterator_to_array($result);
        array_walk($view->result, function DResultRow $row$index) {
          $row->index = $index;
        });

        $view->pager->postExecute($view->result);
        $view->pager->updatePageInfo();
        $view->total_rows = $view->pager->getTotalItems();

        // Load all entities contained in the results.         $this->loadEntities($view->result);
      }
      catch (DatabaseExceptionWrapper $e) {
        $view->result = [];
        if (!empty($view->live_preview)) {
          $this->messenger->addError($e->getMessage());
        }
        
Home | Imprint | This part of the site doesn't use cookies.