Comments (8)
Please check out this branch where i tried to solve that issue: https://github.com/h4cc/AliceFixturesBundle/tree/bug/30-command-reference
You can test it via composer "h4cc/alice-fixtures-bundle": "dev-bug/30-command-reference"
from alicefixturesbundle.
@h4cc no, it didn't works I got the same error
from alicefixturesbundle.
@paquitodev Please check out the README for that case: https://github.com/h4cc/AliceFixturesBundle/tree/bug/30-command-reference#fixturesets-from-different-bundles
from alicefixturesbundle.
@h4cc I have rearranged the order of the bundles in the AppKernel.php
but I still have some doubts. When you said this in docs:
All FixtureSets will use a global state of references. This way the MyUserBundle can use
entities from MyCommonBundle.
You mean I should setup this parameters:
$set = new h4cc\AliceFixturesBundle\Fixtures\FixtureSet(array(
'locale' => 'es_ES',
'seed' => 42,
'do_drop' => true,
'do_persist' => true
));
At config_dev.yml
? If so then this is what you said, right?
h4cc_alice_fixtures:
locale: es_ES # default
seed: 42 # default
do_flush: true # default
do_drop: true
schema_tool: null # default
doctrine: orm # default
And a second one, how I run all sets
if they are defined in different files? Example:
ComunSet.php
lives under ComunBundle
UsuarioSet.php
lives under UsuarioBundle
Or the idea here is to have all in one set regardless where fixtures are?
from alicefixturesbundle.
@paquitodev The a global state of references
means, that when running the load:sets
Command, all then processed fixture sets will share their references.
The values in config*.yml
are just default values, used when FixtureSet do not provide them. There is no need to define them everywhere.
When running load:sets
it is intended to look in the default path in all bundles. It is still possible to only create one single Set if you find that easier to use.
from alicefixturesbundle.
@h4cc this is weird, I have different sets as I said before one living in ComunBundle
and the other at UsuarioBundle
and when I ran the command h4cc_alice_fixtures:load:sets
I got No sets to load
ummm suspicious. In the other side this is how I'm defining my sets:
$set = new h4cc\AliceFixturesBundle\Fixtures\FixtureSet(array(
'locale' => 'es_VE',
'seed' => 42,
'do_drop' => true,
'do_persist' => true
));
$set->addFile(__DIR__ . '/BancoCredito.yml', 'yaml');
$set->addFile(__DIR__ . '/Ciiu.yml', 'yaml');
$set->addFile(__DIR__ . '/CodigoArancelario.yml', 'yaml');
$set->addFile(__DIR__ . '/Pais.yml', 'yaml');
$set->addFile(__DIR__ . '/Estado.yml', 'yaml');
$set->addFile(__DIR__ . '/Municipio.yml', 'yaml');
$set->addFile(__DIR__ . '/Ciudad.yml', 'yaml');
$set->addFile(__DIR__ . '/Parroquia.yml', 'yaml');
$set->addFile(__DIR__ . '/CondicionProducto.yml', 'yaml');
$set->addFile(__DIR__ . '/ComiteTecnico.yml', 'yaml');
$set->addFile(__DIR__ . '/EstadoSolicitud.yml', 'yaml');
$set->addFile(__DIR__ . '/FinalidadProducto.yml', 'yaml');
$set->addFile(__DIR__ . '/OficinaRegional.yml', 'yaml');
$set->addFile(__DIR__ . '/ProcedenciaProducto.yml', 'yaml');
$set->addFile(__DIR__ . '/TipoEmpresa.yml', 'yaml');
$set->addFile(__DIR__ . '/TipoRecaudo.yml', 'yaml');
$set->addFile(__DIR__ . '/TipoRegistro.yml', 'yaml');
$set->addFile(__DIR__ . '/TipoServicio.yml', 'yaml');
$set->addFile(__DIR__ . '/TipoTramite.yml', 'yaml');
$set->addFile(__DIR__ . '/TipoUsuario.yml', 'yaml');
return $set;
Do I need to take care around order? I mean if I have a relationship where, lets say, CondicionProducto
and TipoTramite
are involve, then I need to load this two first and after the fixture for the relationship or not? How entities order works here?
And yes I can just make a single Set but I'll like to keep them separately since it's better as far as regards organization this unless it's mandatory to have all the fixtures in only one set (I do not think so according to the documentation)
from alicefixturesbundle.
Do I need to take care around order?
Every file in your Set will be loaded on its own, sequentially: https://github.com/h4cc/AliceFixturesBundle/blob/bug/30-command-reference/Fixtures/FixtureManager.php#L142
I think you need to order them for internal references to work. .. or your simply concatenate the content of all files to a single one and give it to to the FixtureSet.
from alicefixturesbundle.
Thanks for your contribution @paquitodev, there will be some changes:
- The commands for loading files or sets will share the references between all loaded fixtures.
- The ORM Detach has also to be removed for this to work, seemed to be unnecessary anyway.
- The Yaml Fixture files still have to be consistent on file basis. Like if
a.yml
referencesb.yml
and back, its not going to work.
from alicefixturesbundle.
Related Issues (20)
- Error in the new version HOT 2
- How to use AliceFixturesBundle within DoctrineFixturesBundle? HOT 3
- Add Ordering for Fixture Sets
- Loading fixtures by string instead of files. HOT 1
- Working with Doctrine Proxy Objects or References HOT 2
- Loading fixtures which rely on associationKey with generation fails HOT 5
- Troubleshooting entities which are not created HOT 2
- Multiple paths for YAML files and FixtureSets
- Handle doctrine resolved interfaces HOT 2
- Missing dependencies when creating custom Faker Providers HOT 4
- Using custom faker data providers without standard doctrine fixtures HOT 2
- Dependencies issue HOT 1
- Make this bundle work with alice v2.0 HOT 1
- h4cc_alice_fixtures:load:files trunkates migration_versions table HOT 4
- Function remove on fixture manager does not delete all the fixtures in a db
- Doctrine 2.5 Embeddables
- FixtureSets contain no reference to the used manager
- Can't reference entities' ID inside a Fixtures Set HOT 1
- On errors give the fixture yaml filename
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from alicefixturesbundle.