class TestAddForm
Same name and namespace in other branches
- 9 core/modules/media_library/tests/modules/media_library_form_overwrite_test/src/Form/TestAddForm.php \Drupal\media_library_form_overwrite_test\Form\TestAddForm
- 10 core/modules/media_library/tests/modules/media_library_form_overwrite_test/src/Form/TestAddForm.php \Drupal\media_library_form_overwrite_test\Form\TestAddForm
- 11.x core/modules/media_library/tests/modules/media_library_form_overwrite_test/src/Form/TestAddForm.php \Drupal\media_library_form_overwrite_test\Form\TestAddForm
Test add form.
Hierarchy
- class \Drupal\Core\Form\FormBase extends \Drupal\Core\Form\FormInterface, \Drupal\Core\DependencyInjection\ContainerInjectionInterface uses \Drupal\Core\DependencyInjection\DependencySerializationTrait, \Drupal\Core\Routing\LinkGeneratorTrait, \Drupal\Core\Logger\LoggerChannelTrait, \Drupal\Core\Messenger\MessengerTrait, \Drupal\Core\Routing\RedirectDestinationTrait, \Drupal\Core\StringTranslation\StringTranslationTrait, \Drupal\Core\Routing\UrlGeneratorTrait
- class \Drupal\media_library\Form\AddFormBase extends \Drupal\Core\Form\BaseFormIdInterface, \Drupal\Core\Security\TrustedCallbackInterface implements \Drupal\Core\Form\FormBase
- class \Drupal\media_library_form_overwrite_test\Form\TestAddForm implements \Drupal\media_library\Form\AddFormBase
- class \Drupal\media_library\Form\AddFormBase extends \Drupal\Core\Form\BaseFormIdInterface, \Drupal\Core\Security\TrustedCallbackInterface implements \Drupal\Core\Form\FormBase
Expanded class hierarchy of TestAddForm
2 files declare their use of TestAddForm
- MediaLibraryAddFormTest.php in core/
modules/ media_library/ tests/ src/ Kernel/ MediaLibraryAddFormTest.php - media_library_form_overwrite_test.module in core/
modules/ media_library/ tests/ modules/ media_library_form_overwrite_test/ media_library_form_overwrite_test.module - Contains.
File
-
core/
modules/ media_library/ tests/ modules/ media_library_form_overwrite_test/ src/ Form/ TestAddForm.php, line 11
Namespace
Drupal\media_library_form_overwrite_test\FormView source
class TestAddForm extends AddFormBase {
/**
* {@inheritdoc}
*/
protected function buildInputElement(array $form, FormStateInterface $form_state) {
return [];
}
/**
* {@inheritdoc}
*/
public function getFormId() {
return 'test_add_form';
}
}
Members
Title Sort descending | Deprecated | Modifiers | Object type | Summary | Overriden Title | Overrides |
---|---|---|---|---|---|---|
AddFormBase::$entityTypeManager | protected | property | The entity type manager. | |||
AddFormBase::$libraryUiBuilder | protected | property | The media library UI builder. | |||
AddFormBase::$mediaType | protected | property | The type of media items being created by this form. | |||
AddFormBase::$openerResolver | protected | property | The opener resolver. | |||
AddFormBase::$viewBuilder | protected | property | The media view builder. | |||
AddFormBase::buildActions | protected | function | Returns an array of supported actions for the form. | |||
AddFormBase::buildCurrentSelectionArea | protected | function | Returns a render array containing the current selection. | |||
AddFormBase::buildEntityFormElement | protected | function | Builds the sub-form for setting required fields on a new media item. | 1 | ||
AddFormBase::buildForm | public | function | Form constructor. | Overrides FormInterface::buildForm | ||
AddFormBase::buildMediaLibraryUi | protected | function | Build the render array of the media library UI. | |||
AddFormBase::buildSelectedItemElement | protected | function | Returns a render array for a single pre-selected media item. | |||
AddFormBase::create | public static | function | Instantiates a new instance of this class. | Overrides FormBase::create | 2 | |
AddFormBase::createMediaFromValue | protected | function | Creates a new, unsaved media item from a source field value. | 1 | ||
AddFormBase::getAddedMediaItems | protected | function | Get all added media items from the form state. | |||
AddFormBase::getBaseFormId | public | function | Returns a string identifying the base form. | Overrides BaseFormIdInterface::getBaseFormId | ||
AddFormBase::getCurrentMediaItems | protected | function | Get all pre-selected and added media items from the form state. | |||
AddFormBase::getMediaLibraryState | protected | function | Get the media library state from the form state. | |||
AddFormBase::getMediaType | protected | function | Get the media type from the form state. | 2 | ||
AddFormBase::getPreSelectedMediaItems | protected | function | Get all pre-selected media items from the form state. | |||
AddFormBase::getSourceFieldName | protected | function | Returns the name of the source field for a media type. | |||
AddFormBase::isAdvancedUi | protected | function | Determines if the "advanced UI" of the Media Library is enabled. | |||
AddFormBase::prepareMediaEntityForSave | protected | function | Prepares a created media item to be permanently saved. | 1 | ||
AddFormBase::preRenderAddedMedia | public | function | Converts the set of newly added media into an item list for rendering. | |||
AddFormBase::processInputValues | protected | function | Creates media items from source field input values. | |||
AddFormBase::removeButtonSubmit | public | function | Submit handler for the remove button. | 1 | ||
AddFormBase::submitForm | public | function | Form submission handler. | Overrides FormInterface::submitForm | ||
AddFormBase::trustedCallbacks | public static | function | Lists the trusted callbacks provided by the implementing class. | Overrides TrustedCallbackInterface::trustedCallbacks | ||
AddFormBase::updateFormCallback | public | function | AJAX callback to update the entire form based on source field input. | |||
AddFormBase::updateLibrary | public | function | AJAX callback to send the new media item(s) to the media library. | |||
AddFormBase::updateWidget | public | function | AJAX callback to send the new media item(s) to the calling code. | |||
AddFormBase::validateForm | public | function | Form validation handler. | Overrides FormBase::validateForm | ||
AddFormBase::validateMediaEntity | protected | function | Validate a created media item. | |||
AddFormBase::__construct | public | function | Constructs a AddFormBase object. | 2 | ||
DependencySerializationTrait::$_entityStorages | protected | property | An array of entity type IDs keyed by the property name of their storages. | |||
DependencySerializationTrait::$_serviceIds | protected | property | An array of service IDs keyed by property name used for serialization. | |||
DependencySerializationTrait::__sleep | public | function | 1 | |||
DependencySerializationTrait::__wakeup | public | function | 2 | |||
FormBase::$configFactory | protected | property | The config factory. | 3 | ||
FormBase::$requestStack | protected | property | The request stack. | 1 | ||
FormBase::$routeMatch | protected | property | The route match. | |||
FormBase::config | protected | function | Retrieves a configuration object. | |||
FormBase::configFactory | protected | function | Gets the config factory for this form. | 3 | ||
FormBase::container | private | function | Returns the service container. | |||
FormBase::currentUser | protected | function | Gets the current user. | |||
FormBase::getRequest | protected | function | Gets the request object. | |||
FormBase::getRouteMatch | protected | function | Gets the route match. | |||
FormBase::logger | protected | function | Gets the logger for a specific channel. | |||
FormBase::redirect | protected | function | Returns a redirect response object for the specified route. | Overrides UrlGeneratorTrait::redirect | ||
FormBase::resetConfigFactory | public | function | Resets the configuration factory. | |||
FormBase::setConfigFactory | public | function | Sets the config factory for this form. | |||
FormBase::setRequestStack | public | function | Sets the request stack object to use. | |||
LinkGeneratorTrait::$linkGenerator | protected | property | The link generator. | 1 | ||
LinkGeneratorTrait::getLinkGenerator | Deprecated | protected | function | Returns the link generator. | ||
LinkGeneratorTrait::l | Deprecated | protected | function | Renders a link to a route given a route name and its parameters. | ||
LinkGeneratorTrait::setLinkGenerator | Deprecated | public | function | Sets the link generator service. | ||
LoggerChannelTrait::$loggerFactory | protected | property | The logger channel factory service. | |||
LoggerChannelTrait::getLogger | protected | function | Gets the logger for a specific channel. | |||
LoggerChannelTrait::setLoggerFactory | public | function | Injects the logger channel factory. | |||
MessengerTrait::$messenger | protected | property | The messenger. | 17 | ||
MessengerTrait::messenger | public | function | Gets the messenger. | 17 | ||
MessengerTrait::setMessenger | public | function | Sets the messenger. | |||
RedirectDestinationTrait::$redirectDestination | protected | property | The redirect destination service. | 1 | ||
RedirectDestinationTrait::getDestinationArray | protected | function | Prepares a 'destination' URL query parameter for use with \Drupal\Core\Url. | |||
RedirectDestinationTrait::getRedirectDestination | protected | function | Returns the redirect destination service. | |||
RedirectDestinationTrait::setRedirectDestination | public | function | Sets the redirect destination service. | |||
StringTranslationTrait::$stringTranslation | protected | property | The string translation service. | |||
StringTranslationTrait::formatPlural | protected | function | Formats a string containing a count of items. | |||
StringTranslationTrait::getNumberOfPlurals | protected | function | Returns the number of plurals supported by a given language. | |||
StringTranslationTrait::getStringTranslation | protected | function | Gets the string translation service. | |||
StringTranslationTrait::setStringTranslation | public | function | Sets the string translation service to use. | 2 | ||
StringTranslationTrait::t | protected | function | Translates a string to the current language or to a given language. | |||
TestAddForm::buildInputElement | protected | function | Builds the element for submitting source field value(s). | Overrides AddFormBase::buildInputElement | ||
TestAddForm::getFormId | public | function | Returns a unique string identifying the form. | Overrides FormInterface::getFormId | ||
TrustedCallbackInterface::THROW_EXCEPTION | constant | Untrusted callbacks throw exceptions. | ||||
TrustedCallbackInterface::TRIGGER_SILENCED_DEPRECATION | constant | Untrusted callbacks trigger silenced E_USER_DEPRECATION errors. | ||||
TrustedCallbackInterface::TRIGGER_WARNING | constant | Untrusted callbacks trigger E_USER_WARNING errors. | ||||
UrlGeneratorTrait::$urlGenerator | protected | property | The url generator. | |||
UrlGeneratorTrait::getUrlGenerator | Deprecated | protected | function | Returns the URL generator service. | ||
UrlGeneratorTrait::setUrlGenerator | Deprecated | public | function | Sets the URL generator service. | ||
UrlGeneratorTrait::url | Deprecated | protected | function | Generates a URL or path for a specific route based on the given parameters. |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.