Commit f56ea0b4 authored by dj3c1t's avatar dj3c1t

sourceType and authorRole ids in fixtures

parent 1699a85c
......@@ -17,12 +17,16 @@ class LoadSourceMLBaseData implements FixtureInterface {
public function loadSourceTypes(ObjectManager $manager) {
$sourceTypes = array(
"album",
"track",
"source",
1 => "album",
2 => "track",
3 => "source",
);
foreach($sourceTypes as $sourceTypeName) {
foreach($sourceTypes as $id => $sourceTypeName) {
$sourceType = new SourceType();
$metadata = $manager->getClassMetaData(get_class($sourceType));
$metadata->setIdGeneratorType(\Doctrine\ORM\Mapping\ClassMetadata::GENERATOR_TYPE_NONE);
$metadata->setIdGenerator(new \Doctrine\ORM\Id\AssignedGenerator());
$sourceType->setId($id);
$sourceType->setName($sourceTypeName);
$manager->persist($sourceType);
}
......@@ -31,12 +35,16 @@ class LoadSourceMLBaseData implements FixtureInterface {
public function loadAuthorRoles(ObjectManager $manager) {
$authorRoles = array(
"admin",
"editor",
"contributor",
1 => "admin",
2 => "editor",
3 => "contributor",
);
foreach($authorRoles as $authorRoleName) {
foreach($authorRoles as $id => $authorRoleName) {
$authorRole = new AuthorRole();
$metadata = $manager->getClassMetaData(get_class($authorRole));
$metadata->setIdGeneratorType(\Doctrine\ORM\Mapping\ClassMetadata::GENERATOR_TYPE_NONE);
$metadata->setIdGenerator(new \Doctrine\ORM\Id\AssignedGenerator());
$authorRole->setId($id);
$authorRole->setName($authorRoleName);
$manager->persist($authorRole);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment