clean install

This commit is contained in:
2024-12-10 15:08:16 +01:00
commit e14eb2d8fd
31193 changed files with 3555714 additions and 0 deletions

View File

@@ -0,0 +1,11 @@
langcode: en
status: true
dependencies:
enforced:
module:
- farm_seed
id: seed
label: Seed
description: ''
workflow: asset_default
new_revision: true

View File

@@ -0,0 +1,10 @@
name: Seed asset
description: Adds a Seed asset type.
type: module
package: farmOS Assets
core_version_requirement: ^10
dependencies:
- farm:asset
- farm:farm_entity
- farm:farm_plant_type
- farm:farm_season

View File

@@ -0,0 +1,57 @@
<?php
namespace Drupal\farm_seed\Plugin\Asset\AssetType;
use Drupal\farm_entity\Plugin\Asset\AssetType\FarmAssetType;
/**
* Provides the seed asset type.
*
* @AssetType(
* id = "seed",
* label = @Translation("Seed"),
* )
*/
class Seed extends FarmAssetType {
/**
* {@inheritdoc}
*/
public function buildFieldDefinitions() {
$fields = parent::buildFieldDefinitions();
$field_info = [
'plant_type' => [
'type' => 'entity_reference',
'label' => $this->t('Crop/variety'),
'description' => $this->t("Enter this seed asset's crop/variety."),
'target_type' => 'taxonomy_term',
'target_bundle' => 'plant_type',
'auto_create' => TRUE,
'required' => TRUE,
'multiple' => TRUE,
'weight' => [
'form' => -90,
'view' => -90,
],
],
'season' => [
'type' => 'entity_reference',
'label' => $this->t('Season'),
'description' => $this->t('Assign this to a season for easier searching later.'),
'target_type' => 'taxonomy_term',
'target_bundle' => 'season',
'auto_create' => TRUE,
'multiple' => TRUE,
'weight' => [
'form' => -50,
'view' => -50,
],
],
];
foreach ($field_info as $name => $info) {
$fields[$name] = $this->farmFieldFactory->bundleFieldDefinition($info);
}
return $fields;
}
}