mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 22:53:49 +00:00
cs: Fix code style (safe rules only).
This commit is contained in:
@@ -1,4 +1,12 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Chill is a software for social workers
|
||||
*
|
||||
* For the full copyright and license information, please view
|
||||
* the LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Chill\PersonBundle\DataFixtures\ORM;
|
||||
@@ -10,8 +18,9 @@ use Doctrine\Persistence\ObjectManager;
|
||||
|
||||
class LoadRelations extends Fixture implements FixtureGroupInterface
|
||||
{
|
||||
public const RELATION_KEY = 'relations';
|
||||
public const RELATIONS = [
|
||||
public const RELATION_KEY = 'relations';
|
||||
|
||||
public const RELATIONS = [
|
||||
['title' => ['fr' => 'Mère'], 'reverseTitle' => ['fr' => 'Fille']],
|
||||
['title' => ['fr' => 'Mère'], 'reverseTitle' => ['fr' => 'Fils']],
|
||||
['title' => ['fr' => 'Père'], 'reverseTitle' => ['fr' => 'Fille']],
|
||||
@@ -38,17 +47,16 @@ class LoadRelations extends Fixture implements FixtureGroupInterface
|
||||
|
||||
public function load(ObjectManager $manager)
|
||||
{
|
||||
foreach (self::RELATIONS as $key => $value){
|
||||
print "Creating a new relation type: relation" . $value['title']['fr'] . "reverse relation: " . $value['reverseTitle']['fr'] . "\n";
|
||||
foreach (self::RELATIONS as $key => $value) {
|
||||
echo 'Creating a new relation type: relation' . $value['title']['fr'] . 'reverse relation: ' . $value['reverseTitle']['fr'] . "\n";
|
||||
$relation = new Relation();
|
||||
$relation->setTitle($value['title'])
|
||||
->setReverseTitle($value['reverseTitle']);
|
||||
$manager->persist($relation);
|
||||
|
||||
$this->addReference(self::RELATION_KEY.$key, $relation);
|
||||
$this->addReference(self::RELATION_KEY . $key, $relation);
|
||||
}
|
||||
|
||||
$manager->flush();
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user