Test.php in farmOS 2.x
Same filename in this branch
- 2.x modules/core/quick/tests/modules/farm_quick_test/src/Plugin/QuickForm/Test.php
- 2.x modules/asset/group/tests/modules/farm_group_test/src/Plugin/Log/LogType/Test.php
- 2.x modules/asset/equipment/tests/modules/farm_entity_test/src/Plugin/Log/LogType/Test.php
- 2.x modules/core/entity/tests/modules/farm_entity_test/src/Plugin/Log/LogType/Test.php
- 2.x modules/core/entity/tests/modules/farm_entity_test/src/Plugin/Asset/AssetType/Test.php
- 2.x modules/core/entity/tests/modules/farm_entity_test/src/Plugin/Plan/PlanType/Test.php
File
modules/core/entity/tests/modules/farm_entity_test/src/Plugin/Log/LogType/Test.phpView source
<?php
namespace Drupal\farm_entity_test\Plugin\Log\LogType;
use Drupal\farm_entity\Plugin\Log\LogType\FarmLogType;
/**
* Provides the test log type.
*
* @LogType(
* id = "test",
* label = @Translation("Test"),
* )
*/
class Test extends FarmLogType {
/**
* {@inheritdoc}
*/
public function buildFieldDefinitions() {
$fields = parent::buildFieldDefinitions();
// Add a test field to all Log bundles.
$options = [
'type' => 'string',
'label' => $this
->t('Test default bundle field'),
];
$fields['test_default_bundle_field'] = $this->farmFieldFactory
->bundleFieldDefinition($options);
return $fields;
}
}