1 | <?php |
||
19 | abstract class EntityFieldDeriverBase extends DeriverBase implements ContainerDeriverInterface { |
||
20 | use DependencySerializationTrait; |
||
21 | |||
22 | /** |
||
23 | * Provides plugin definition values from fields. |
||
24 | * |
||
25 | * @param string $entityTypeId |
||
26 | * The host entity type. |
||
27 | * @param string $bundle |
||
28 | * The host bundle. |
||
29 | * @param \Drupal\Core\Field\FieldStorageDefinitionInterface $fieldDefinition |
||
30 | * Field definition object. |
||
31 | * @param array $basePluginDefinition |
||
32 | * Base definition array. |
||
33 | * |
||
34 | * @return array |
||
35 | * The derived plugin definitions for the given field. |
||
36 | */ |
||
37 | abstract protected function getDerivativeDefinitionsFromFieldDefinition($entityTypeId, $bundle, FieldStorageDefinitionInterface $fieldDefinition, array $basePluginDefinition); |
||
38 | |||
39 | /** |
||
40 | * The entity type manager. |
||
41 | * |
||
42 | * @var \Drupal\Core\Entity\EntityTypeManagerInterface |
||
43 | */ |
||
44 | protected $entityTypeManager; |
||
45 | |||
46 | /** |
||
47 | * The entity field manager. |
||
48 | * |
||
49 | * @var \Drupal\Core\Entity\EntityFieldManagerInterface |
||
50 | */ |
||
51 | protected $entityFieldManager; |
||
52 | |||
53 | /** |
||
54 | * The entity bundle info. |
||
55 | * |
||
56 | * @var \Drupal\Core\Entity\EntityTypeBundleInfoInterface |
||
57 | */ |
||
58 | protected $entityBundleInfo; |
||
59 | |||
60 | /** |
||
61 | * The base plugin id. |
||
62 | * |
||
63 | * @var string |
||
64 | */ |
||
65 | protected $basePluginId; |
||
66 | |||
67 | /** |
||
68 | * {@inheritdoc} |
||
69 | */ |
||
70 | public static function create(ContainerInterface $container, $basePluginId) { |
||
78 | |||
79 | /** |
||
80 | * RawValueFieldItemDeriver constructor. |
||
81 | * |
||
82 | * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entityTypeManager |
||
83 | * The entity type manager. |
||
84 | * @param \Drupal\Core\Entity\EntityFieldManagerInterface $entityFieldManager |
||
85 | * The entity field manager. |
||
86 | * @param \Drupal\Core\Entity\EntityTypeBundleInfoInterface $entityTypeBundleInfo |
||
87 | * The bundle info service. |
||
88 | * @param string $basePluginId |
||
89 | * The base plugin id. |
||
90 | */ |
||
91 | public function __construct( |
||
102 | |||
103 | /** |
||
104 | * {@inheritdoc} |
||
105 | */ |
||
106 | public function getDerivativeDefinitions($basePluginDefinition) { |
||
121 | |||
122 | /** |
||
123 | * Get accessible (non-internal) properties of a field. |
||
124 | * |
||
125 | * @param \Drupal\Core\Field\FieldStorageDefinitionInterface $fieldStorageDefinition |
||
126 | * The field storage definition. |
||
127 | * |
||
128 | * @return DataDefinitionInterface[] |
||
129 | * The property data definitions. |
||
130 | */ |
||
131 | protected function getAccessiblePropertyDefinitions(FieldStorageDefinitionInterface $fieldStorageDefinition) { |
||
136 | |||
137 | } |
||
138 |