Home Documentation Download Pricing Buy Now

External mapped superclass (inheritance)

0 votes

Hi,

I'm trying to create an "User" entity that extends "FOS\UserBundle\Entity\User". I got two problems:
- There is no option to specify an external mapped superclass (not defined in the skipper model).
- I can't use the same entity name twice (even if they are on different bundles/namespaces).

Anyone have this issue too? Any workarounds?

Thanks!

asked Nov 11, 2014 in Solved by iavansis.miguel (320 points)

1 Answer

0 votes
 
Best answer

Unfortunately both of actions you need aren't possible right now. Currently each entity in Skipper has to have a unique name (we have it in our todo list to change this) and all entities have to be available in model.

answered Nov 11, 2014 by ludek.vodicka Skipper developer (140,530 points)
selected Nov 12, 2014 by iavansis.miguel

Thanks Ludek,

As workaround, I can include all FOSUserBundle entities in my Skipper model ¿can I mark this bundle as not exportable or something like?

You can include any model you need in your project. Currently it's not possible to mark any module as read-only, but you can simply remove "Data Format" and "Relative export path" settings and model will not be exported:

enter image description here

Thanks!

I'll try with this workaround.

The trick works,
I've followed these steps:

  • Create a bundle named "FOSUserBundle"
  • Set the bundle namespace to "FOS\"
  • Set the bundle export data format to "" (avoids export)
  • Create an entity named "UserBundle\Entity\User" without any fields. (avoids entity name conflict in Skipper)
  • Create an entity "User" that inherits from "UserBundle\Entity\User"

Thanks!

I'm glad you have found a solution! Thanks for sharing the guide.

...