jsonapi_test_reference_types.module
Same filename in other branches
Contains hook implementations for the jsonapi_test_reference_types module.
File
-
core/
modules/ jsonapi/ tests/ modules/ jsonapi_test_reference_types/ jsonapi_test_reference_types.module
View source
<?php
/**
* @file
* Contains hook implementations for the jsonapi_test_reference_types module.
*/
use Drupal\Core\Entity\EntityTypeInterface;
use Drupal\Core\Field\BaseFieldDefinition;
/**
* Implements hook_entity_base_field_info().
*/
function jsonapi_test_reference_types_entity_base_field_info(EntityTypeInterface $entity_type) {
// Add a field of the deprecated reference type to nodes.
if ($entity_type->id() === 'node') {
$fields = [];
$fields['deprecated_reference'] = BaseFieldDefinition::create('jsonapi_test_deprecated_reference')->setLabel(t('Reference'))
->setDescription(t('Deprecated reference field.'));
return $fields;
}
}
Functions
Title | Deprecated | Summary |
---|---|---|
jsonapi_test_reference_types_entity_base_field_info | Implements hook_entity_base_field_info(). |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.