Initial Drupal 11 with DDEV setup

This commit is contained in:
gluebox
2025-10-08 11:39:17 -04:00
commit 89ef74b305
25344 changed files with 2599172 additions and 0 deletions

View File

@ -0,0 +1,65 @@
<?php
declare(strict_types=1);
namespace Drupal\{{ machine_name }}\Plugin\EntityReferenceSelection;
{% apply sort_namespaces %}
use Drupal\Core\Entity\Attribute\EntityReferenceSelection;
use Drupal\Core\Entity\Query\QueryInterface;
use Drupal\Core\StringTranslation\TranslatableMarkup;
{% if configurable %}
use Drupal\Core\Form\FormStateInterface;
{% endif %}
use {{ base_class_full }}{% if base_class == class %} as Base{{ base_class }}{% endif %};
{% endapply %}
/**
* @todo Add plugin description here.
*/
#[EntityReferenceSelection(
id: '{{ plugin_id }}',
label: new TranslatableMarkup('{{ plugin_label }}'),
group: '{{ plugin_id }}',
weight: 1,
entity_types: ['{{ entity_type }}'],
)]
final class {{ class }} extends {{ base_class == class ? 'Base' ~ base_class : base_class }} {
{% if configurable %}
/**
* {@inheritdoc}
*/
public function defaultConfiguration(): array {
$default_configuration = [
'foo' => 'bar',
];
return $default_configuration + parent::defaultConfiguration();
}
/**
* {@inheritdoc}
*/
public function buildConfigurationForm(array $form, FormStateInterface $form_state): array {
$form = parent::buildConfigurationForm($form, $form_state);
$form['foo'] = [
'#type' => 'textfield',
'#title' => $this->t('Foo'),
'#default_value' => $this->configuration['foo'],
];
return $form;
}
{% endif %}
/**
* {@inheritdoc}
*/
protected function buildEntityQuery($match = NULL, $match_operator = 'CONTAINS'): QueryInterface {
$query = parent::buildEntityQuery($match, $match_operator);
// @todo Modify the query here.
return $query;
}
}

View File

@ -0,0 +1,10 @@
entity_reference_selection.{{ plugin_id }}:
{# User selection plugin provides has some additional options. #}
type: entity_reference_selection.default{{ entity_type == 'user' ? ':user' }}
label: '{{ plugin_label }} handler settings'
{% if configurable %}
mapping:
foo:
type: string
label: Foo
{% endif %}