3

I have a database that I want to create entities only for the tables with ax_ appended onto the front of it.

I have search everywhere are cant find any explanations.

php app/console doctrine:mapping:import --force AxxessORMBundle yml

This is the command I am using to create my entities

Jed
  • 929
  • 2
  • 19
  • 32
  • I assume you are creating tables using MySQL first and then importing? I know it's probably not ideal but have you tried it the other way and using http://symfony.com/doc/current/bundles/DoctrineMigrationsBundle/index.html#manual-tables – qooplmao May 25 '14 at 02:45
  • Its an existing database – Jed May 26 '14 at 05:38
  • I have tried most things i the symfony documentation – Jed May 26 '14 at 05:59

2 Answers2

2

This will filter out the ax_ tables

schema_filter: ~^(?!ax_)~

I am however wanting to only use the ax_ tables

Jed
  • 929
  • 2
  • 19
  • 32
0

Looking at the code for ImportMappingDoctrineCommand there is a filter option

->addOption(
    'filter', 
    null, 
    InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 
    'A string pattern used to match entities that should be mapped.'
)

which I think you would be able to add your ax_.

This answer (paraphrased) says to convert and then import like so..

Convert

php app/console doctrine:mapping:convert xml
    ./src/Axxess/ORMBundle/Resources/config/doctrine/metadata/orm 
    --from-database --force

Import

php app/console doctrine:mapping:import AxxessORMBundle yml --filter="ax_"
Community
  • 1
  • 1
qooplmao
  • 17,622
  • 2
  • 44
  • 69
  • I'm so sorry ! I miss click and without realizing made a downvote ! I've noted it just now. If you want to I can remove it but you have to edit the answer because it doesn't allow me to take it back. – Esteban Filardi Apr 22 '16 at 00:25