You are here

public function Harvest::buildFieldDefinitions in farmOS 2.x

Overrides LogTypeBase::buildFieldDefinitions

File

modules/log/harvest/src/Plugin/Log/LogType/Harvest.php, line 20

Class

Harvest
Provides the harvest log type.

Namespace

Drupal\farm_harvest\Plugin\Log\LogType

Code

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' => 20,
      'view' => 20,
    ],
  ];
  $fields['lot_number'] = $this->farmFieldFactory
    ->bundleFieldDefinition($options);
  return $fields;
}