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

Extended section model #109

Closed
czende opened this issue Dec 2, 2017 · 3 comments · Fixed by #110
Closed

Extended section model #109

czende opened this issue Dec 2, 2017 · 3 comments · Fixed by #110
Labels

Comments

@czende
Copy link

czende commented Dec 2, 2017

Hi, I want to add some other info into Section model, so I've overridden your resource in my config to use my model with extending your BaseSection and added Section.orm.yml with custom field. But when I try to launch doctrine:migrations:diff it always throw error: The table with name 'shop.bitbag_section' already exists.. I did it the same way as with the product model extensions and never seen this kind of error before. How do I find out where the problem is?

Thank you!

...app/config/resources.yml

sylius_resource:
    resources:
        bitbag.section:
            classes:
                model: AppBundle\Entity\Section
            translation:
                classes:
                    model: AppBundle\Entity\SectionTranslation

Model

namespace AppBundle\Entity;

use BitBag\CmsPlugin\Entity\Section as BaseSection;

class Section extends BaseSection {
...
}

...src/AppBundle/Resources/config/doctrine/Section.orm.yml

AppBundle\Entity\Section:
    type: entity
    table: bitbag_section
    fields:
        type:
            ...

@bitbager
Copy link
Member

bitbager commented Dec 2, 2017

This is because currently we are defining models as entities instead of mapped superclasses. I will try to fix it soon.

@bitbager
Copy link
Member

bitbager commented Dec 2, 2017

The problem should be fixed on 1.3.0-dev version. Upgrade your plugin, don't forget to read the UPGRADE.md guide and let me know if it works 🙂

@czende
Copy link
Author

czende commented Dec 4, 2017

Thank you. It seems to be working with superclass fix, but another error appear. When I'm trying to extend section translation and run doctrine migrations diff - There is no column with name 'translatable_id' on table 'bitbag_section_translation'. But column is there and my section translation is properly set up to extend your translation.

bitbager pushed a commit that referenced this issue Jul 16, 2018
Bring more PHPStan power to the skeleton!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants