| Conditions | 2 |
| Paths | 2 |
| Total Lines | 17 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 13 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 14 | 1 | public function load(ObjectManager $manager) |
|
| 15 | { |
||
| 16 | 1 | $data = include(dirname(__DIR__) . '/fixtures/projects.php'); |
|
| 17 | 1 | foreach ($data as $projectData) { |
|
| 18 | $project = |
||
| 19 | 1 | (new Project()) |
|
| 20 | 1 | ->setId($projectData['id']) |
|
| 21 | 1 | ->setName($projectData['name']) |
|
| 22 | 1 | ->setDescription($projectData['description']) |
|
| 23 | 1 | ->setSlug($projectData['slug']) |
|
| 24 | 1 | ->setProductOwner($this->getReference("product-owner-{$projectData['product_owner_id']}")) |
|
| 25 | 1 | ->setCreatedAt(new \DateTime($projectData['created_at'])) |
|
| 26 | ; |
||
| 27 | 1 | $manager->persist($project); |
|
| 28 | 1 | $this->addReference("project-{$projectData['slug']}", $project); |
|
| 29 | } |
||
| 30 | 1 | $manager->flush(); |
|
| 31 | 1 | } |
|
| 38 |