You are here

Test.php in farmOS 2.x

File

modules/core/entity/tests/modules/farm_entity_test/src/Plugin/Log/LogType/Test.php
View 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;
  }

}

Classes

Namesort descending Description
Test Provides the test log type.