PardotCampaignListBuilder.php in Pardot Integration 8
File
src/Controller/PardotCampaignListBuilder.php
View source
<?php
namespace Drupal\pardot\Controller;
use Drupal\Core\Config\Entity\ConfigEntityListBuilder;
use Drupal\Core\Entity\EntityInterface;
class PardotCampaignListBuilder extends ConfigEntityListBuilder {
public function buildHeader() {
$header['label'] = $this
->t('Campaign Label');
$header['campaign_id'] = $this
->t('Pardot Campaign ID');
return $header + parent::buildHeader();
}
public function buildRow(EntityInterface $entity) {
$row['label'] = $entity
->label();
$row['campaign_id'] = $entity->campaign_id;
return $row + parent::buildRow($entity);
}
public function render() {
$build['description'] = array(
'#markup' => $this
->t("<p>Additional Pardot Campaigns for specific paths, on which, the default campaign will be overridden.</p>"),
);
$build[] = parent::render();
return $build;
}
}