craue / CraueConfigBundle

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

prevent creating the default table when using a custom entity #50

Closed craue closed 5 years ago

craue commented 5 years ago

An approach to possibly fix #36.

What I don't like is that BaseSetting.orm.xml will need to be duplicated (in separated folders due to doctrine/DoctrineBundle#209), so let me know if there's a cleaner way.

coveralls commented 5 years ago

Coverage Status

Coverage remained the same at 100.0% when pulling e0006ceb493ff0fa2109b781bd4a8777c8e5e099 on prevent-creating-default-table-with-custom-entity into 7c386c00c5e7fe29df18e649bf37403886e4bdd7 on master.

crmpicco commented 5 years ago

@craue Thanks for responding so quickly to yesterday's comment on #36

My Craue Config in config.yml looks like this:

craue_config:
    entity_name: CRMPiccoBundle\Entity\ConfigSetting

and I extend the BaseSetting parent class like this:

/**
 * ConfigSetting entity for the config_setting table.
 *
 * @author Craig R Morton <crmpicco@aol.com>
 * @date 03-07-2017
 */

namespace CRMPiccoBundle\Entity;

use Craue\ConfigBundle\Entity\BaseSetting;
use Doctrine\ORM\Mapping as ORM;

/**
 * @ORM\Entity(repositoryClass="Craue\ConfigBundle\Repository\SettingRepository")
 * @ORM\Table(name="config_setting")
 */
class ConfigSetting extends BaseSetting
{

This PR looks great to me. It would be great if this was merged in and released to save me maintaining a fork as this bundle does exactly what I need it to do (and more).

Thanks 👍

crmpicco commented 5 years ago

Hi @craue, is this likely to be merged in soon?

craue commented 5 years ago

I was hoping for some more feedback from people actually trying the code about whether it really works as expected and solves the issue.

craue commented 5 years ago

Version 2.3.0 is out containing this feature.

crmpicco commented 5 years ago

You're a ⭐️ !