class Input in farmOS 2.x
Provides the input log type.
Plugin annotation
@LogType(
id = "input",
label = @Translation("Input"),
)
Hierarchy
- class \Drupal\Component\Plugin\PluginBase implements DerivativeInspectionInterface, PluginInspectionInterface
- class \Drupal\Core\Plugin\PluginBase uses DependencySerializationTrait, MessengerTrait, StringTranslationTrait
- class \Drupal\farm_entity\FarmEntityTypeBase implements ContainerFactoryPluginInterface
- class \Drupal\farm_entity\Plugin\Log\LogType\LogTypeBase implements LogTypeInterface
- class \Drupal\farm_entity\Plugin\Log\LogType\FarmLogType uses StringTranslationTrait
- class \Drupal\farm_input\Plugin\Log\LogType\Input
- class \Drupal\farm_entity\Plugin\Log\LogType\FarmLogType uses StringTranslationTrait
- class \Drupal\farm_entity\Plugin\Log\LogType\LogTypeBase implements LogTypeInterface
- class \Drupal\farm_entity\FarmEntityTypeBase implements ContainerFactoryPluginInterface
- class \Drupal\Core\Plugin\PluginBase uses DependencySerializationTrait, MessengerTrait, StringTranslationTrait
Expanded class hierarchy of Input
2 string references to 'Input'
- KmlImporter::buildForm in modules/
core/ import/ modules/ kml/ src/ Form/ KmlImporter.php - Form constructor.
- log.type.input.yml in modules/
log/ input/ config/ install/ log.type.input.yml - modules/log/input/config/install/log.type.input.yml
File
- modules/
log/ input/ src/ Plugin/ Log/ LogType/ Input.php, line 15
Namespace
Drupal\farm_input\Plugin\Log\LogTypeView source
class Input extends FarmLogType {
/**
* {@inheritdoc}
*/
public function buildFieldDefinitions() {
$fields = parent::buildFieldDefinitions();
// Lot number.
$options = [
'type' => 'string',
'label' => $this
->t('Lot number'),
'description' => $this
->t('If this harvest is part of a batch or lot, enter the lot number here.'),
'weight' => [
'form' => -45,
'view' => -45,
],
];
$fields['lot_number'] = $this->farmFieldFactory
->bundleFieldDefinition($options);
// Method.
$options = [
'type' => 'string',
'label' => $this
->t('Method'),
'description' => $this
->t('How was this input applied?'),
'weight' => [
'form' => -30,
'view' => -30,
],
];
$fields['method'] = $this->farmFieldFactory
->bundleFieldDefinition($options);
// Purchase date.
$options = [
'type' => 'timestamp',
'label' => $this
->t('Purchase date'),
'description' => $this
->t('When was this input purchased (if applicable)?'),
'weight' => [
'form' => -35,
'view' => -35,
],
];
$fields['purchase_date'] = $this->farmFieldFactory
->bundleFieldDefinition($options);
// Source.
$options = [
'type' => 'string',
'label' => $this
->t('Source'),
'description' => $this
->t('Where was this input obtained? Who manufactured it?'),
'weight' => [
'form' => -40,
'view' => -40,
],
];
$fields['source'] = $this->farmFieldFactory
->bundleFieldDefinition($options);
return $fields;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
DependencySerializationTrait:: |
protected | property | ||
DependencySerializationTrait:: |
protected | property | ||
DependencySerializationTrait:: |
public | function | 2 | |
DependencySerializationTrait:: |
public | function | 2 | |
FarmEntityTypeBase:: |
protected | property | The farm_field.factory service. | |
FarmEntityTypeBase:: |
public static | function |
Creates an instance of the plugin. Overrides ContainerFactoryPluginInterface:: |
|
FarmEntityTypeBase:: |
public | function |
Constructs a \Drupal\Component\Plugin\PluginBase object. Overrides PluginBase:: |
|
Input:: |
public | function |
Overrides LogTypeBase:: |
|
LogTypeBase:: |
public | function |
Gets the log type label. Overrides LogTypeInterface:: |
|
LogTypeBase:: |
public | function |
Gets the log workflow ID. Overrides LogTypeInterface:: |
|
MessengerTrait:: |
protected | property | The messenger. | 27 |
MessengerTrait:: |
public | function | Gets the messenger. | 27 |
MessengerTrait:: |
public | function | Sets the messenger. | |
PluginBase:: |
protected | property | Configuration information passed into the plugin. | 1 |
PluginBase:: |
protected | property | The plugin implementation definition. | 1 |
PluginBase:: |
protected | property | The plugin_id. | |
PluginBase:: |
constant | A string which is used to separate base plugin IDs from the derivative ID. | ||
PluginBase:: |
public | function |
Gets the base_plugin_id of the plugin instance. Overrides DerivativeInspectionInterface:: |
|
PluginBase:: |
public | function |
Gets the derivative_id of the plugin instance. Overrides DerivativeInspectionInterface:: |
|
PluginBase:: |
public | function |
Gets the definition of the plugin implementation. Overrides PluginInspectionInterface:: |
2 |
PluginBase:: |
public | function |
Gets the plugin_id of the plugin instance. Overrides PluginInspectionInterface:: |
|
PluginBase:: |
public | function | Determines if the plugin is configurable. | |
StringTranslationTrait:: |
protected | property | The string translation service. | 4 |
StringTranslationTrait:: |
protected | function | Formats a string containing a count of items. | |
StringTranslationTrait:: |
protected | function | Returns the number of plurals supported by a given language. | |
StringTranslationTrait:: |
protected | function | Gets the string translation service. | |
StringTranslationTrait:: |
public | function | Sets the string translation service to use. | 2 |
StringTranslationTrait:: |
protected | function | Translates a string to the current language or to a given language. |