21
21
use Symfony \Component \DependencyInjection \ContainerAwareTrait ;
22
22
23
23
/**
24
- * Defines the sample data to load in the database when running the unit and
25
- * functional tests.
26
- *
27
- * Execute this command to load the data:
24
+ * Defines the sample blog posts to load in the database before running the unit
25
+ * and functional tests. Execute this command to load the data.
28
26
*
29
27
* $ php bin/console doctrine:fixtures:load
30
28
*
@@ -53,8 +51,9 @@ public function load(ObjectManager $manager)
53
51
$ post ->setSummary ($ this ->getRandomPostSummary ());
54
52
$ post ->setSlug ($ this ->container ->get ('slugger ' )->slugify ($ post ->getTitle ()));
55
53
$ post ->setContent ($ this ->getPostContent ());
56
- // This reference has been added in UserFixtures class and contains
57
- // an instance of User entity.
54
+ // "References" are the way to share objects between fixtures defined
55
+ // in different files. This reference has been added in the UserFixtures
56
+ // file and it contains an instance of the User entity.
58
57
$ post ->setAuthor ($ this ->getReference ('anna-admin ' ));
59
58
$ post ->setPublishedAt (new \DateTime ('now - ' .$ i .'days ' ));
60
59
@@ -79,8 +78,9 @@ public function load(ObjectManager $manager)
79
78
}
80
79
81
80
/**
82
- * This method must return an array of fixtures classes
83
- * on which the implementing class depends on.
81
+ * Instead of defining the exact order in which the fixtures files must be loaded,
82
+ * this method defines which other fixtures this file depends on. Then, Doctrine
83
+ * will figure out the best order to fit all the dependencies.
84
84
*
85
85
* @return array
86
86
*/
@@ -170,14 +170,14 @@ private function getPhrases()
170
170
'Eposs sunt solems de superbus fortis ' ,
171
171
'Vae humani generis ' ,
172
172
'Diatrias tolerare tanquam noster caesium ' ,
173
- 'Teres talis orgias saepe tractare de camerarius flavum sensorem ' ,
173
+ 'Teres talis saepe tractare de camerarius flavum sensorem ' ,
174
174
'Silva de secundus galatae demitto quadra ' ,
175
175
'Sunt accentores vitare salvus flavum parses ' ,
176
- 'Potus sensim ducunt ad ferox abnoba ' ,
176
+ 'Potus sensim ad ferox abnoba ' ,
177
177
'Sunt seculaes transferre talis camerarius fluctuies ' ,
178
178
'Era brevis ratione est ' ,
179
179
'Sunt torquises imitari velox mirabilis medicinaes ' ,
180
- 'Cum mineralis persuadere omnes finises desiderium bi-color ' ,
180
+ 'Mineralis persuadere omnes finises desiderium ' ,
181
181
'Bassus fatalis classiss virtualiter transferre de flavum ' ,
182
182
];
183
183
}
0 commit comments