Skip to content
Snippets Groups Projects
Commit fc8749b4 authored by Andrey Vitushkin's avatar Andrey Vitushkin
Browse files

Issue #3456603: Create FeedsTarget plugin for the "ipaddress_pgsql" field type

parent 77f357e5
No related branches found
No related tags found
No related merge requests found
<?php
namespace Drupal\field_ipaddress_pgsql\Feeds\Target;
use Drupal\Core\Field\FieldDefinitionInterface;
use Drupal\feeds\FieldTargetDefinition;
use Drupal\feeds\Plugin\Type\Target\FieldTargetBase;
/**
* Defines a field mapper for "ipaddress_pgsql" Field.
*
* @FeedsTarget(
* id = "ipaddress_pgsql",
* field_types = {"ipaddress_pgsql"}
* )
*/
class IpAddressPostgreSql extends FieldTargetBase {
/**
* {@inheritdoc}
*/
protected static function prepareTarget(FieldDefinitionInterface $field_definition) {
$definition = FieldTargetDefinition::createFromFieldDefinition($field_definition);
$definition->addProperty('value');
if ($field_definition->getSetting('default_gateway_enabled')) {
$definition->addProperty('default_gateway');
}
return $definition;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment