/** * {@inheritdoc} */ protected static function prepareTarget(FieldDefinitionInterface $field_definition) { $definition = FieldTargetDefinition::createFromFieldDefinition($field_definition)->addProperty('value'); if ($field_definition->getType() === 'string') { $definition->markPropertyUnique('value'); } return $definition; }
/** * {@inheritdoc} */ protected static function prepareTarget(FieldDefinitionInterface $field_definition) { $definition = FieldTargetDefinition::createFromFieldDefinition($field_definition)->addProperty('value'); if ($field_definition->getType() === 'text_with_summary') { $definition->addProperty('summary'); } return $definition; }
/** * {@inheritdoc} */ protected static function prepareTarget(FieldDefinitionInterface $field_definition) { // Only reference content entities. Configuration entities will need custom // targets. $type = $field_definition->getSetting('target_type'); if (!\Drupal::entityManager()->getDefinition($type)->isSubclassOf('\\Drupal\\Core\\Entity\\ContentEntityInterface')) { return; } return FieldTargetDefinition::createFromFieldDefinition($field_definition)->addProperty('target_id'); }
/** * {@inheritdoc} */ protected static function prepareTarget(FieldDefinitionInterface $field_definition) { return FieldTargetDefinition::createFromFieldDefinition($field_definition)->addProperty('uri')->addProperty('title'); }
/** * {@inheritdoc} */ protected static function prepareTarget(FieldDefinitionInterface $field_definition) { return FieldTargetDefinition::createFromFieldDefinition($field_definition)->addProperty('value')->markPropertyUnique('value'); }
/** * {@inheritdoc} */ protected static function prepareTarget(FieldDefinitionInterface $field_definition) { return FieldTargetDefinition::createFromFieldDefinition($field_definition)->addProperty('target_id')->addProperty('description'); }