Exemple #1
0
 /**
  * {@inheritdoc}
  */
 public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL)
 {
     parent::init($view, $display, $options);
     // TODO needed?
     //     $this->base_table = $view->base_table;
     //     $this->baseField = $view->base_field;
 }
Exemple #2
0
 /**
  * {@inheritdoc}
  */
 public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL)
 {
     parent::init($view, $display, $options);
     $this->entityTypeId = $this->definition['entity_type'];
     $this->entityType = $this->entityManager->getDefinition($this->entityTypeId);
     $this->base_table = $this->entityType->getDataTable() ?: $this->entityType->getBaseTable();
     $this->base_field = $this->entityType->getKey('id');
 }
Exemple #3
0
 /**
  * {@inheritdoc}
  */
 public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL)
 {
     parent::init($view, $display, $options);
     if (!empty($this->options['field_options'])) {
         $options = (array) $this->options['field_options'];
         // Prepare a trimmed version of replacement aliases.
         $aliases = static::extractFromOptionsArray('alias', $options);
         $this->replacementAliases = array_filter(array_map('trim', $aliases));
         // Prepare an array of raw output field options.
         $this->rawOutputOptions = static::extractFromOptionsArray('raw_output', $options);
     }
 }
 /**
  * {@inheritdoc}
  */
 public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL)
 {
     parent::init($view, $display, $options);
     $base_table = $view->storage->get('base_table');
     if (substr($base_table, 0, 17) !== 'search_api_index_') {
         throw new \InvalidArgumentException(SafeMarkup::format('View %view is not based on Search API but tries to use its row plugin.', array('%view' => $view->storage->label())));
     }
     $index_id = substr($base_table, 17);
     $this->index = $this->getEntityManager()->getStorage('search_api_index')->load($index_id);
 }
Exemple #5
0
  /**
   * {@inheritdoc}
   */
  public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL) {
    parent::init($view, $display, $options);

    $base_table = $view->storage->get('base_table');
    $this->index = SearchApiQuery::getIndexFromTable($base_table, $this->getEntityManager());
    if (!$this->index) {
      throw new \InvalidArgumentException(new FormattableMarkup('View %view is not based on Search API but tries to use its row plugin.', array('%view' => $view->storage->label())));
    }
  }