protected function FarmFieldFactory::modifyInventoryField in farmOS 2.x
Inventory field modifier.
Parameters
\Drupal\Core\Field\BaseFieldDefinition &$field: A base field definition object.
array $options: An array of options.
1 call to FarmFieldFactory::modifyInventoryField()
- FarmFieldFactory::buildFieldDefinition in modules/
core/ field/ src/ FarmFieldFactory.php - Builds a field definition with farmOS opinions.
File
- modules/
core/ field/ src/ FarmFieldFactory.php, line 710
Class
- FarmFieldFactory
- Factory for generating farmOS field definitions.
Namespace
Drupal\farm_fieldCode
protected function modifyInventoryField(BaseFieldDefinition &$field, array $options = []) {
// Build view display settings.
$field
->setDisplayOptions('view', [
'label' => 'inline',
'type' => 'inventory',
'weight' => $options['weight']['view'] ?? 0,
]);
}