change chemical to be taxonomy term
This commit is contained in:
@@ -1,12 +0,0 @@
|
|||||||
langcode: en
|
|
||||||
status: true
|
|
||||||
dependencies:
|
|
||||||
enforced:
|
|
||||||
module:
|
|
||||||
- farm_agrikern
|
|
||||||
id: chemical
|
|
||||||
label: Chemical
|
|
||||||
description: 'Chemical Asset'
|
|
||||||
name_pattern: 'Chemical asset [asset:id]'
|
|
||||||
workflow: asset_default
|
|
||||||
new_revision: true
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace Drupal\farm_agrikern\Plugin\Asset\AssetType;
|
|
||||||
|
|
||||||
use Drupal\farm_entity\Plugin\Asset\AssetType\FarmAssetType;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Provides the chemical asset type.
|
|
||||||
*
|
|
||||||
* @AssetType(
|
|
||||||
* id = "chemical",
|
|
||||||
* label = @Translation("Chemical"),
|
|
||||||
* )
|
|
||||||
*/
|
|
||||||
class Chemical extends FarmAssetType {
|
|
||||||
/**
|
|
||||||
* {@inheritdoc}
|
|
||||||
*/
|
|
||||||
public function buildFieldDefinitions() {
|
|
||||||
$fields = parent::buildFieldDefinitions();
|
|
||||||
return $fields;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -22,11 +22,12 @@ class Ingredient extends FarmAssetType {
|
|||||||
'chemical_field' => [
|
'chemical_field' => [
|
||||||
'type' => 'entity_reference',
|
'type' => 'entity_reference',
|
||||||
'label' => $this->t('Chemical'),
|
'label' => $this->t('Chemical'),
|
||||||
'description' => $this->t('What chemical does the ingredient track?'),
|
'description' => $this->t("What chemical does the ingredient track?"),
|
||||||
'target_type' => 'asset',
|
'target_type' => 'taxonomy_term',
|
||||||
'target_bundle' => 'chemical',
|
'target_bundle' => 'chemical',
|
||||||
'multiple' => FALSE,
|
'auto_create' => FALSE,
|
||||||
'required' => TRUE,
|
'required' => TRUE,
|
||||||
|
'multiple' => FALSE,
|
||||||
],
|
],
|
||||||
'amount_field' => [
|
'amount_field' => [
|
||||||
'type' => 'fraction',
|
'type' => 'fraction',
|
||||||
|
|||||||
Reference in New Issue
Block a user