Support for @pbf module

Created on 18 April 2024, about 1 year ago

Problem/Motivation

It would be very useful to have feeds also for this awesome Permissions by field β†’ module.

Here is my proposed source code, can anyone review and provide a patch ?

New file : /feeds/src/Feeds/Target/FieldPermissions.php
+<?php
+
+namespace Drupal\feeds\Feeds\Target;
+
+use Drupal\Core\Field\FieldDefinitionInterface;
+use Drupal\feeds\FieldTargetDefinition;
+
+/**
+ * Defines an entity reference mapper.
+ *
+ * @FeedsTarget(
+ *   id = "pbf",
+ *   field_types = {"pbf"}
+ * )
+ */
+class FieldPermissions extends EntityReference {
+
+  /**
+   * {@inheritdoc}
+   */
+  protected static function prepareTarget(FieldDefinitionInterface $field_definition){
+    // add the additional parameters compared to the standard EntityReference.
+    return FieldTargetDefinition::createFromFieldDefinition($field_definition)
+      ->addProperty('target_id')
+      ->addProperty('grant_public')
+      ->addProperty('grant_view')
+      ->addProperty('grant_update')
+      ->addProperty('grant_delete');
+  }
+}
πŸ’¬ Support request
Status

Active

Version

3.0

Component

Code

Created by

πŸ‡ΈπŸ‡°Slovakia coaston

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @coaston
  • Status changed to Closed: duplicate 16 days ago
  • πŸ‡³πŸ‡±Netherlands megachriz

    Feeds only aims to provide mapping targets for fields defined by Drupal Core. This looks like to request support for a field type by a contrib module, so the FeedsTarget plugin should be added to that module instead.

    I see an issue already exist there, so closing this as a duplicate as well.
    ✨ Feeds mapper Active

Production build 0.71.5 2024