Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Using a custom entity for settings" doesn't work #43

Open
Sentence opened this issue Mar 9, 2018 · 2 comments
Open

"Using a custom entity for settings" doesn't work #43

Sentence opened this issue Mar 9, 2018 · 2 comments

Comments

@Sentence
Copy link

Sentence commented Mar 9, 2018

Doctrine doesn't recognite the changes with Symfony 3.4.6, so cannot change the value's type to text, like described in here.

@legumanP2T
Copy link

In symfony 4.4 the only way I found was:
parameters:
craue_config.entity_name: App\Entity\MySetting

nor
config:
...
nor
parameters:
craue_config:
entity_name: App\Entity\MySetting

And it still want to create the craue_config_setting default table…

@krkxone
Copy link

krkxone commented Mar 19, 2021

Create a file named 'craue_config.yaml' inside your "config/packages"-Folder.
Insert this:

craue_config:
  entity_name: App\Entity\YOURENTITY

After that, create you entity like this:

<?php

namespace App\Entity;

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

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

You also have to create a file like "craue.yaml" inside your "config\routes"-Folder.

craue_config_settings_modify:
  path: /admin/settings/configuration
  defaults:
    _controller: Craue\ConfigBundle\Controller\SettingsController::modifyAction

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants