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_product
id: product
label: Product
description: ''
workflow: asset_default
new_revision: true

View File

@@ -0,0 +1,11 @@
langcode: en
status: true
dependencies:
enforced:
module:
- farm_product
id: asset_product
color: blue
conditions:
asset_type:
- product

View File

@@ -0,0 +1,9 @@
name: Product asset
description: Adds an Product asset type.
type: module
package: farmOS Assets
core_version_requirement: ^10
dependencies:
- farm:asset
- farm:farm_entity
- farm:farm_product_type

View File

@@ -0,0 +1,43 @@
<?php
namespace Drupal\farm_product\Plugin\Asset\AssetType;
use Drupal\farm_entity\Plugin\Asset\AssetType\FarmAssetType;
/**
* Provides the product asset type.
*
* @AssetType(
* id = "product",
* label = @Translation("Product"),
* )
*/
class Product extends FarmAssetType {
/**
* {@inheritdoc}
*/
public function buildFieldDefinitions() {
$fields = parent::buildFieldDefinitions();
$field_info = [
'product_type' => [
'type' => 'entity_reference',
'label' => $this->t('Product type'),
'description' => $this->t("Enter the type of product."),
'target_type' => 'taxonomy_term',
'target_bundle' => 'product_type',
'auto_create' => TRUE,
'required' => TRUE,
'weight' => [
'form' => -90,
'view' => -50,
],
],
];
foreach ($field_info as $name => $info) {
$fields[$name] = $this->farmFieldFactory->bundleFieldDefinition($info);
}
return $fields;
}
}