Harvest.php in farmOS 2.x
File
modules/log/harvest/src/Plugin/Log/LogType/Harvest.php
View source
<?php
namespace Drupal\farm_harvest\Plugin\Log\LogType;
use Drupal\farm_entity\Plugin\Log\LogType\FarmLogType;
class Harvest extends FarmLogType {
public function buildFieldDefinitions() {
$fields = parent::buildFieldDefinitions();
$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;
}
}
Classes
Name |
Description |
Harvest |
Provides the harvest log type. |