Completed
Pull Request — master (#157)
by
unknown
01:46
created

DriverFieldPluginManager   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 48
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 1
dl 0
loc 48
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A getFilterableTarget() 0 9 1
1
<?php
2
3
namespace Drupal\Driver\Plugin;
4
5
/**
6
 * Provides the plugin manager for the Driver's field plugins.
7
 */
8
class DriverFieldPluginManager extends DriverPluginManagerBase
9
{
10
11
  /**
12
   * {@inheritdoc}
13
   */
14
    protected $driverPluginType = 'DriverField';
15
16
  /**
17
   * {@inheritdoc}
18
   */
19
    protected $filters = [
20
    'fieldNames',
21
    'fieldTypes',
22
    'entityBundles',
23
    'entityTypes'
24
    ];
25
26
  /**
27
   * {@inheritdoc}
28
   */
29
    protected $specificityCriteria = [
30
    ['fieldNames', 'entityBundles', 'entityTypes'],
31
    ['fieldNames', 'entityBundles'],
32
    ['fieldNames', 'entityTypes'],
33
    ['fieldNames', 'fieldTypes'],
34
    ['fieldNames'],
35
    ['fieldTypes', 'entityBundles'],
36
    ['fieldTypes', 'entityTypes'],
37
    ['fieldTypes'],
38
    ['entityBundles', 'entityTypes'],
39
    ['entityBundles'],
40
    ['entityTypes'],
41
    ];
42
43
  /**
44
   * {@inheritdoc}
45
   */
46
    protected function getFilterableTarget($field)
47
    {
48
        return [
49
        'fieldNames' => $field->getName(),
50
        'fieldTypes' => $field->getType(),
51
        'entityTypes' =>$field->getEntityType(),
52
        'entityBundles' => $field->getBundle()
53
        ];
54
    }
55
}
56