X-Git-Url: https://yaffs.net/gitweb/?a=blobdiff_plain;f=web%2Fmodules%2Fcontrib%2Fctools%2Ftests%2Fmodules%2Fctools_wizard_test%2Fsrc%2FExampleConfigEntityListBuilder.php;fp=web%2Fmodules%2Fcontrib%2Fctools%2Ftests%2Fmodules%2Fctools_wizard_test%2Fsrc%2FExampleConfigEntityListBuilder.php;h=47d3ecf663db11286ca1367c37c0eef0053ad1e9;hb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;hp=0000000000000000000000000000000000000000;hpb=57c063afa3f66b07c4bbddc2d6129a96d90f0aad;p=yaffs-website diff --git a/web/modules/contrib/ctools/tests/modules/ctools_wizard_test/src/ExampleConfigEntityListBuilder.php b/web/modules/contrib/ctools/tests/modules/ctools_wizard_test/src/ExampleConfigEntityListBuilder.php new file mode 100644 index 000000000..47d3ecf66 --- /dev/null +++ b/web/modules/contrib/ctools/tests/modules/ctools_wizard_test/src/ExampleConfigEntityListBuilder.php @@ -0,0 +1,49 @@ +t('Example config entity'); + $header['id'] = $this->t('Machine name'); + return $header + parent::buildHeader(); + } + + /** + * {@inheritdoc} + */ + public function buildRow(EntityInterface $entity) { + $row['label'] = $this->getLabel($entity); + $row['id'] = $entity->id(); + // You probably want a few more properties here... + return $row + parent::buildRow($entity); + } + + /** + * @inheritDoc + */ + public function getOperations(EntityInterface $entity) { + $operations = parent::getOperations($entity); + + if (!empty($operations['edit'])) { + /** @var \Drupal\Core\Url $edit */ + $edit = $operations['edit']['url']; + $edit->setRouteParameters([ + 'machine_name' => $entity->id(), + 'step' => 'general', + ]); + } + + return $operations; + } + +}