Skip to content

Commit

Permalink
Implement GroupFixtureInterface in fixture class
Browse files Browse the repository at this point in the history
  • Loading branch information
chives committed Mar 19, 2019
1 parent 19bb4ff commit e51c2fe
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion DataFixtures/ORM/LoadCommunityTypeData.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@

namespace FSi\Bundle\TerytDatabaseBundle\DataFixtures\ORM;

use Doctrine\Bundle\FixturesBundle\FixtureGroupInterface;
use Doctrine\Bundle\FixturesBundle\ORMFixtureInterface;
use Doctrine\Common\Persistence\ObjectManager;
use FSi\Bundle\TerytDatabaseBundle\Entity\CommunityType;

class LoadCommunityTypeData implements ORMFixtureInterface
class LoadCommunityTypeData implements ORMFixtureInterface, FixtureGroupInterface
{
protected $communityTypes = [
1 => 'gmina miejska',
Expand All @@ -27,6 +28,11 @@ class LoadCommunityTypeData implements ORMFixtureInterface
9 => 'delegatura gminy miejskiej'
];

public static function getGroups(): array
{
return ['teryt'];
}

public function load(ObjectManager $manager): void
{
foreach ($this->communityTypes as $type => $name) {
Expand Down

0 comments on commit e51c2fe

Please sign in to comment.