Skip to content

Commit 9fff470

Browse files
committed
Merge branch 'master' of github.com:smart-gamma/fixtures-generator
2 parents 34ef832 + 0be77a4 commit 9fff470

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

README.md

+21-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@
22

33
Allow speed up fixtures creation by generating fixtures classes from project's database
44

5+
##Install
6+
```
7+
php composer.phar require --dev gamma/fixtures-generator
8+
```
9+
10+
Add to AppKernel.php to dev section:
11+
```
12+
$bundles[] = new Gamma\FixturesGeneratorBundle\GammaFixturesGeneratorBundle();
13+
```
14+
515
##Configuration:
616

717
add to app/config.yml
@@ -17,4 +27,14 @@ app/console gamma:fixtures:generate "\Gamma\Bundle\Entity\Item" --id="1,2,3" - g
1727
app/console gamma:fixtures:generate "\Gamma\Bundle\Entity\Item" --id="1,2,3" --force-add-reference - generate entities with ids 1,2,3 from table and add txt reference
1828
```
1929

20-
Note: Relations ManyToMany should be created additionally manually
30+
##Notes
31+
32+
1.Despite of the autoincrement generator is reset if you use schema recreate before fixture loading, better stick to defined ids via direct setter
33+
34+
Add for each fixture class:
35+
```
36+
$metadata = $manager->getClassMetaData('\Gamma\Bundle\Entity\Item');
37+
$metadata->setIdGeneratorType(\Doctrine\ORM\Mapping\ClassMetadata::GENERATOR_TYPE_NONE);
38+
```
39+
40+
2. Relations ManyToMany should be created additionally manually

0 commit comments

Comments
 (0)