mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-01 12:33:49 +00:00
Pass class as second parameter to getReference() fixture method
This commit is contained in:
@@ -12,6 +12,7 @@ declare(strict_types=1);
|
||||
namespace Chill\MainBundle\DataFixtures\ORM;
|
||||
|
||||
use Chill\MainBundle\Entity\RoleScope;
|
||||
use Chill\MainBundle\Entity\Scope;
|
||||
use Doctrine\Common\DataFixtures\AbstractFixture;
|
||||
use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
|
||||
use Doctrine\Persistence\ObjectManager;
|
||||
@@ -55,8 +56,8 @@ class LoadRoleScopes extends AbstractFixture implements OrderedFixtureInterface
|
||||
foreach (LoadScopes::$references as $scopeReference) {
|
||||
$roleScope = new RoleScope();
|
||||
$roleScope->setRole($key)
|
||||
->setScope($this->getReference($scopeReference, null));
|
||||
$reference = 'role_scope_'.$key.'_'.$this->getReference($scopeReference, null)->getName()['en'];
|
||||
->setScope($this->getReference($scopeReference, Scope::class));
|
||||
$reference = 'role_scope_'.$key.'_'.$this->getReference($scopeReference, Scope::class)->getName()['en'];
|
||||
echo "Creating {$reference} \n";
|
||||
$this->addReference($reference, $roleScope);
|
||||
$manager->persist($roleScope);
|
||||
|
Reference in New Issue
Block a user