1414 * @author Daniel Espendiller <[email protected] > 1515 */ 
1616public  class  DoctrineEntityLookupElement  extends  LookupElement  {
17- 
1817    private  final  String  entityName ;
19-     private  final  PhpClass  className ;
18+     private  final  String  className ;
2019    private  boolean  useClassNameAsLookupString  = false ;
2120    private  DoctrineTypes .Manager  manager ;
2221    private  boolean  isWeak  = false ;
@@ -26,14 +25,14 @@ public DoctrineEntityLookupElement(String entityName, PhpClass className, boolea
2625        this .useClassNameAsLookupString  = useClassNameAsLookupString ;
2726    }
2827
29-     public  DoctrineEntityLookupElement (String  entityName , PhpClass  className , boolean  useClassNameAsLookupString , boolean  isWeak ) {
30-         this (entityName , className , useClassNameAsLookupString );
28+     public  DoctrineEntityLookupElement (String  entityName , PhpClass  phpClass , boolean  useClassNameAsLookupString , boolean  isWeak ) {
29+         this (entityName , phpClass , useClassNameAsLookupString );
3130        this .isWeak  = isWeak ;
3231    }
3332
34-     public  DoctrineEntityLookupElement (String  entityName , PhpClass  className ) {
33+     public  DoctrineEntityLookupElement (String  entityName , PhpClass  phpClass ) {
3534        this .entityName  = entityName ;
36-         this .className  = className ;
35+         this .className  = StringUtils . stripStart ( phpClass . getFQN (),  " \\ " ) ;
3736    }
3837
3938    public  DoctrineEntityLookupElement  withManager (DoctrineTypes .Manager  manager ) {
@@ -44,46 +43,42 @@ public DoctrineEntityLookupElement withManager(DoctrineTypes.Manager manager) {
4443    @ NotNull 
4544    @ Override 
4645    public  String  getLookupString () {
47- 
48-         if (this .useClassNameAsLookupString ) {
49-             return  StringUtils .stripStart (this .className .getPresentableFQN (), "\\ " );
46+         if  (this .useClassNameAsLookupString ) {
47+             return  this .className ;
5048        }
5149
5250        return  entityName ;
5351    }
5452
55-     public  void  renderElement (LookupElementPresentation  presentation ) {
56- 
57-         if (this .useClassNameAsLookupString ) {
58-             presentation .setItemText (className .getPresentableFQN ());
53+     public  void  renderElement (@ NotNull  LookupElementPresentation  presentation ) {
54+         if  (this .useClassNameAsLookupString ) {
55+             presentation .setItemText (className );
5956            presentation .setTypeText (getLookupString ());
6057        } else  {
6158            presentation .setItemText (getLookupString ());
62-             presentation .setTypeText (className . getPresentableFQN () );
59+             presentation .setTypeText (className );
6360        }
6461
6562        presentation .setTypeGrayed (true );
66-         if (isWeak ) {
63+         if   (isWeak ) {
6764            // @TODO: remove weak 
6865            presentation .setIcon (getWeakIcon ());
6966        } else  {
7067            presentation .setIcon (getIcon ());
7168        }
72- 
73- 
7469    }
7570
7671    @ Nullable 
7772    private  Icon  getWeakIcon () {
78-         if (manager  == null ) {
73+         if   (manager  == null ) {
7974            return  null ;
8075        }
8176
82-         if (manager  == DoctrineTypes .Manager .ORM ) {
77+         if   (manager  == DoctrineTypes .Manager .ORM ) {
8378            return  Symfony2Icons .DOCTRINE_WEAK ;
8479        }
8580
86-         if (manager  == DoctrineTypes .Manager .MONGO_DB  || manager  == DoctrineTypes .Manager .COUCH_DB ) {
81+         if   (manager  == DoctrineTypes .Manager .MONGO_DB  || manager  == DoctrineTypes .Manager .COUCH_DB ) {
8782            return  Symfony2Icons .NO_SQL ;
8883        }
8984
@@ -92,20 +87,19 @@ private Icon getWeakIcon() {
9287
9388    @ Nullable 
9489    private  Icon  getIcon () {
95-         if (manager  == null ) {
90+         if   (manager  == null ) {
9691            return  null ;
9792        }
9893
99-         if (manager  == DoctrineTypes .Manager .ORM ) {
94+         if   (manager  == DoctrineTypes .Manager .ORM ) {
10095            return  Symfony2Icons .DOCTRINE ;
10196        }
10297
103-         if (manager  == DoctrineTypes .Manager .MONGO_DB  || manager  == DoctrineTypes .Manager .COUCH_DB ) {
98+         if   (manager  == DoctrineTypes .Manager .MONGO_DB  || manager  == DoctrineTypes .Manager .COUCH_DB ) {
10499            return  Symfony2Icons .NO_SQL ;
105100        }
106101
107102        return  null ;
108103    }
109- 
110104}
111105
0 commit comments