Skip to content
This repository has been archived by the owner on Jan 25, 2020. It is now read-only.

Possibility to override the default table name #19

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Possibility to override the default table name #19

wants to merge 5 commits into from

Conversation

emulienfou
Copy link

This allow user to change the name of the default table name created by the bundle.

By default the bundle will add a new table to your database called ktw_menu_items.

This PR allow user to change the table name using a new configuration key:

# app/config/config.yml
ktw_database_menu:
    table_name: menu_items

@kevintweber
Copy link
Owner

Thank you for the pull request. I appreciate your help.

Could you please add some unit tests for the MappingListener?

@emulienfou
Copy link
Author

Hi, I will update my PR with some Unit tests as soon as possible.

@emulienfou
Copy link
Author

Hi @kevintweber, I just got a weird error, when I reload my webpage, I got an exception except the 1st time.
It seems the MappingListener, or an other component try to add each time a new entry in the database.

Error message:

SQLSTATE[23000]: Integrity constraint violation: 19 UNIQUE constraint failed: menu_items.name").

The temporary fix I found is to surround with a try/catch like:

$this->objectManager->persist($menu);
try {
    $this->objectManager->flush();
}
    catch (\Exception $e) {
}

However it's not a good idea!

So, if you have some time to help it would be great! Thanks

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

Successfully merging this pull request may close these issues.

None yet

2 participants