class TestEntityFormInjected
Provides a test entity form that uses injection.
Hierarchy
- class \Drupal\Core\Entity\EntityHandlerBase uses \Drupal\Core\StringTranslation\StringTranslationTrait, \Drupal\Core\DependencyInjection\DependencySerializationTrait- class \Drupal\Tests\Core\Entity\TestEntityForm extends \Drupal\Core\Entity\EntityHandlerBase- class \Drupal\Tests\Core\Entity\TestEntityFormInjected implements \Drupal\Core\DependencyInjection\ContainerInjectionInterface extends \Drupal\Tests\Core\Entity\TestEntityForm
 
 
- class \Drupal\Tests\Core\Entity\TestEntityForm extends \Drupal\Core\Entity\EntityHandlerBase
Expanded class hierarchy of TestEntityFormInjected
File
- 
              core/tests/ Drupal/ Tests/ Core/ Entity/ EntityTypeManagerTest.php, line 493 
Namespace
Drupal\Tests\Core\EntityView source
class TestEntityFormInjected extends TestEntityForm implements ContainerInjectionInterface {
  
  /**
   * The color of the entity type.
   *
   * @var string
   */
  public $color;
  
  /**
   * Constructs a new TestEntityFormInjected.
   *
   * @param string $color
   *   The color of the entity type.
   */
  public function __construct($color) {
    $this->color = $color;
  }
  
  /**
   * {@inheritdoc}
   */
  public static function create(ContainerInterface $container) {
    return new static('yellow');
  }
}Members
| Title Sort descending | Modifiers | Object type | Summary | Overriden Title | Overrides | 
|---|---|---|---|---|---|
| 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 | 2 | ||
| DependencySerializationTrait::__wakeup | public | function | #[\ReturnTypeWillChange] | 2 | |
| EntityHandlerBase::moduleHandler | protected | function | Gets the module handler. | 5 | |
| EntityHandlerBase::setModuleHandler | public | function | Sets the module handler for this handler. | ||
| 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. | ||
| TestEntityForm::$entityTypeManager | protected | property | The entity type manager. | ||
| TestEntityForm::$moduleHandler | public | property | The module handler to invoke hooks on. | Overrides EntityHandlerBase::$moduleHandler | |
| TestEntityForm::$stringTranslation | public | property | The string translation service. | Overrides StringTranslationTrait::$stringTranslation | |
| TestEntityForm::getBaseFormId | public | function | |||
| TestEntityForm::getFormId | public | function | |||
| TestEntityForm::setEntity | public | function | |||
| TestEntityForm::setEntityTypeManager | public | function | |||
| TestEntityForm::setOperation | public | function | |||
| TestEntityFormInjected::$color | public | property | The color of the entity type. | ||
| TestEntityFormInjected::create | public static | function | Instantiates a new instance of this class. | Overrides ContainerInjectionInterface::create | |
| TestEntityFormInjected::__construct | public | function | Constructs a new TestEntityFormInjected. | 
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.
