IndexRecordType.php 1.07 KB
Newer Older
1 2 3 4
<?php

namespace Drupal\views_natural_sort;

5 6
use Drupal\views_natural_sort\Plugin\IndexRecordSourcePluginInterface as EntrySourcePluginInterface;

7 8 9 10
class IndexRecordType {

  protected $entityType;
  protected $field;
11
  protected $entrySourcePlugin;
12

13 14 15 16
  public function __construct($entity_type_id, $field_machine_name, $entry_source_plugin) {
    $this->setEntityType($entity_type_id)
      ->setField($field_machine_name)
      ->setEntrySourcePlugin($entry_source_plugin);
17 18 19 20 21 22 23 24
  }

  public function getEntityType() {
    return $this->entityType;
  }

  public function setEntityType($entity_type_id) {
    $this->entityType = $entity_type_id;
25
    return $this;
26 27 28 29 30 31 32 33
  }

  public function getField() {
    return $this->field;
  }

  public function setField($field_machine_name) {
    $this->field = $field_machine_name;
34 35 36 37 38
    return $this;
  }

  public function getEntrySourcePlugin() {
    return $this->entrySourcePlugin;
39
  }
40 41 42 43 44 45 46

  public function setEntrySourcePlugin(EntrySourcePluginInterface $entry_source_plugin) {
    $this->entrySourcePlugin = $entry_source_plugin;
    return $this;
  }


47
}