diff --git a/src/Plugin/Log/LogType/FieldWork.php b/src/Plugin/Log/LogType/FieldWork.php index e065d02..4a6bcd0 100644 --- a/src/Plugin/Log/LogType/FieldWork.php +++ b/src/Plugin/Log/LogType/FieldWork.php @@ -12,7 +12,7 @@ use Drupal\farm_entity\Plugin\Log\LogType\FarmLogType; * label = @Translation("Field work"), * ) */ -class FieldWork extends FarmLogType { +class FieldWork extends WorkLog { /** * {@inheritdoc} */ diff --git a/src/Plugin/Log/LogType/WorkLog.php b/src/Plugin/Log/LogType/WorkLog.php new file mode 100644 index 0000000..08d7432 --- /dev/null +++ b/src/Plugin/Log/LogType/WorkLog.php @@ -0,0 +1,36 @@ + [ + 'type' => 'entity_reference', + 'label' => $this->t('Work'), + 'description' => $this->t("What type of work was done?"), + 'target_type' => 'taxonomy_term', + 'target_bundle' => 'work', + 'auto_create' => FALSE, + 'required' => TRUE, + 'multiple' => FALSE, + ], + ]; + + foreach ($field_info as $name => $info) { + $fields[$name] = \Drupal::service('farm_field.factory')->bundleFieldDefinition($info); + } + + return $fields; + } +}