craue / CraueConfigBundle

Database-stored settings made available via a service for your Symfony project.
MIT License
173 stars 35 forks source link

Move Entity configuration to separate yml file #19

Closed rvanlaak closed 7 years ago

rvanlaak commented 9 years ago

As already discussed in #18 the Setting entity mapping is coded using annotations, which makes it impossible to override it. So what I'd like to propose is to move from Annotations to a yml file so the entity mapping can be overridden in /app/Resources/CraueConfigBundle. That way the bundle doesn't change, but allows others to fix this.

craue commented 9 years ago

How about adding a SettingInterface and allowing to specify the used implementation via config? Would this allow overriding the mapping? But even if it does, I guess it wouldn't allow adding further mappings for e.g. ODM. I'll work on a PR...

rvanlaak commented 9 years ago

By which you mean a SettingsInterface and AbstractSetting class that implements that? Would that allow us to keep the Annotations? They also are my preferred way of managing database mappings :+1:

If we'll be doing this, probably it is better to think about a way to allow multiple types of settings. By which I mean a combination of text and textarea settings. But, that probably means an extra field in the interface right?

craue commented 9 years ago

By which you mean a SettingsInterface and AbstractSetting class that implements that?

Yes.

Would that allow us to keep the Annotations?

I think so, I'm pretty sure I've also done that in one of my apps to override an attribute's mapping of a parent class.

They also are my preferred way of managing database mappings :+1:

Same here. But I still think it's cleaner to outsource the mapping to allow also ODM, like FOSUB does.

If we'll be doing this, probably it is better to think about a way to allow multiple types of settings. By which I mean a combination of text and textarea settings. But, that probably means an extra field in the interface right?

I don't want to add new types.

rvanlaak commented 9 years ago

I don't want to add new types.

Know that, but I'd like to find an implementation where users can easily do that