EpalStudentSectorFieldListBuilder.php 1.55 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
<?php

namespace Drupal\epal;

use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Entity\EntityListBuilder;
use Drupal\Core\Routing\LinkGeneratorTrait;
use Drupal\Core\Url;

/**
 * Defines a class to build a listing of Epal student sector field entities.
 *
 * @ingroup epal
 */
class EpalStudentSectorFieldListBuilder extends EntityListBuilder {

  use LinkGeneratorTrait;

  /**
   * {@inheritdoc}
   */
  public function buildHeader() {
    $header['id'] = $this->t('ID');
    $header['name'] = $this->t('Όνομα');
	$header['student_id'] = $this->t('ID Μαθητή');
    $header['sectorfield_id'] = $this->t('ID Τομέα');
    return $header + parent::buildHeader();
  }

  /**
   * {@inheritdoc}
   */
  public function buildRow(EntityInterface $entity) {
    /* @var $entity \Drupal\epal\Entity\EpalStudentSectorField */
    $row['id'] = $entity->id();
    $row['name'] = $this->l(
      $entity->label(),
      new Url(
        'entity.epal_student_sector_field.edit_form', array(
          'epal_student_sector_field' => $entity->id(),
        )
      )
    );
	
	 $row['student_id'] = $this->l(
      $entity->getStudent_id(),
      new Url(
        'entity.epal_student_course_field.edit_form', array(
          'epal_student_course_field' => $entity->id(),
        )
      )
    );
    $row['sectorfield_id'] = $this->l(
      $entity->getSectorField_id(),
      new Url(
        'entity.epal_student_sector_field.edit_form', array(
          'epal_student_sector_field' => $entity->id(),
        )
      )
    );
	
    return $row + parent::buildRow($entity);
  }

}