0 votes

Hello,

I use ORM Designer to start a new Symfony 2.3 Project and export all into yml files.
I get that i have to define the Path for the output yml file, but there is no Doctrine File generated.

Do i have to do that in Symfony 2 ? or is there an Option to let ORM Designer also export this?

in Solved by (150 points)
recategorized by

1 Answer

0 votes
Best answer

Hi,

Here is a quick step-by-step walk through how to create new project and export doctrine schema file:

1) As first, create your new project:

enter image description here

2) Edit your module settings via project tree

enter image description here

3) Choose export file and export format

enter image description here

4) Export your model to model files

enter image description here

5) Check exported file

enter image description here

Hope it helps!

by Skipper developer (141k points)
selected by

I did all of that and the yml is in the right place
(Path: #Project#/src/#NameSpace#/TestBundle/Resources/config/doctrine/Test.orm.yml)

But if i i want to generate the Class from that (doctrine:generate:entities TestBundle) doctrine says:

[Doctrine\Common\Persistence\Mapping\MappingException]
Invalid mapping file '#NameSpace#.TestBundle.Entity.Test.orm.yml' for class '#NameSpace#\TestBundle\Entity\Test'.

So is ORM Designer Providing the Entity Class or is there something wrong with my Symfony2.3 + Doctrine ?

ORM Designer only exports YML/XML files so you have to be able to use Doctrine generators as same as you would write the definitions by yourself.

It's hard to say what's exactly wrong but it's possible that you have some logical error in your test model and this error is exported also to the YML files.

The best way how to find what's wrong is manually edit exported YML file and remove as much definitions as possible. Did you try to write some definition files by yourself if generator in S2+D works correctly?

Thank you for your help on this one - my problem was that i had locally no timezone setting and so the console brought up errors.

all it needed was:
doctrine:mapping:import #BundleName# annotation

But thank you for the walk through how this works - the Tuts on the page were over a year old.

You're welcome.