Land.php in farmOS 2.x
File
modules/asset/land/src/Plugin/Asset/AssetType/Land.php
View source
<?php
namespace Drupal\farm_land\Plugin\Asset\AssetType;
use Drupal\farm_entity\Plugin\Asset\AssetType\FarmAssetType;
class Land extends FarmAssetType {
public function buildFieldDefinitions() {
$fields = [];
$options = [
'type' => 'list_string',
'label' => $this
->t('Land type'),
'allowed_values_function' => 'farm_land_type_field_allowed_values',
'required' => TRUE,
'weight' => [
'form' => -50,
'view' => -50,
],
];
$fields['land_type'] = $this->farmFieldFactory
->bundleFieldDefinition($options);
return $fields;
}
}
Classes
Name |
Description |
Land |
Provides the land asset type. |