2
2
3
3
namespace Drupal \ui_patterns \Plugin \UiPatterns \Source ;
4
4
5
- use Drupal \Core \Entity \EntityManager ;
5
+ use Drupal \Core \Entity \EntityFieldManager ;
6
6
use Drupal \Core \Plugin \ContainerFactoryPluginInterface ;
7
7
use Drupal \ui_patterns \Plugin \PatternSourceBase ;
8
8
use Symfony \Component \DependencyInjection \ContainerInterface ;
@@ -24,16 +24,16 @@ class FieldSource extends PatternSourceBase implements ContainerFactoryPluginInt
24
24
/**
25
25
* Entity manager service.
26
26
*
27
- * @var \Drupal\Core\Entity\EntityManager
27
+ * @var \Drupal\Core\Entity\EntityFieldManager
28
28
*/
29
- protected $ entityManager ;
29
+ protected $ entityFieldManager ;
30
30
31
31
/**
32
32
* {@inheritdoc}
33
33
*/
34
- public function __construct (array $ configuration , $ plugin_id , $ plugin_definition , EntityManager $ entity_manager ) {
34
+ public function __construct (array $ configuration , $ plugin_id , $ plugin_definition , EntityFieldManager $ entity_manager ) {
35
35
parent ::__construct ($ configuration , $ plugin_id , $ plugin_definition );
36
- $ this ->entityManager = $ entity_manager ;
36
+ $ this ->entityFieldManager = $ entity_manager ;
37
37
}
38
38
39
39
/**
@@ -44,7 +44,7 @@ public static function create(ContainerInterface $container, array $configuratio
44
44
$ configuration ,
45
45
$ plugin_id ,
46
46
$ plugin_definition ,
47
- $ container ->get ('entity .manager ' )
47
+ $ container ->get ('entity_field .manager ' )
48
48
);
49
49
}
50
50
@@ -53,7 +53,7 @@ public static function create(ContainerInterface $container, array $configuratio
53
53
*/
54
54
public function getSourceFields () {
55
55
$ sources = [];
56
- $ fields = $ this ->entityManager ->getFieldDefinitions ($ this ->getContextProperty ('entity_type ' ), $ this ->getContextProperty ('entity_bundle ' ));
56
+ $ fields = $ this ->entityFieldManager ->getFieldDefinitions ($ this ->getContextProperty ('entity_type ' ), $ this ->getContextProperty ('entity_bundle ' ));
57
57
58
58
/** @var \Drupal\Core\Field\FieldDefinitionInterface $field */
59
59
foreach ($ fields as $ field ) {
0 commit comments