This commit is contained in:
@@ -44,10 +44,10 @@ class HandleCreateLeague
|
|||||||
$leagueDto->validate();
|
$leagueDto->validate();
|
||||||
$leagueEntity = $this->leagueFactory::create($leagueDto);
|
$leagueEntity = $this->leagueFactory::create($leagueDto);
|
||||||
$leagueEntity->setActive(true);
|
$leagueEntity->setActive(true);
|
||||||
$this->assignPresidentRole($leagueEntity->getId(), $userEntity);
|
|
||||||
|
|
||||||
$this->entityManager->persist($leagueEntity);
|
$this->entityManager->persist($leagueEntity);
|
||||||
$this->entityManager->flush();
|
$this->entityManager->flush();
|
||||||
|
$this->assignPresidentRole($leagueEntity->getId(), $userEntity);
|
||||||
|
|
||||||
$leagueDto->id = $leagueEntity->getId();
|
$leagueDto->id = $leagueEntity->getId();
|
||||||
$leagueDto->createdAt = $leagueEntity->getCreatedAt();
|
$leagueDto->createdAt = $leagueEntity->getCreatedAt();
|
||||||
@@ -66,5 +66,6 @@ class HandleCreateLeague
|
|||||||
$leaguePresidentRole->setEntityId($leagueId);
|
$leaguePresidentRole->setEntityId($leagueId);
|
||||||
$leaguePresidentRole->setUser($userEntity);
|
$leaguePresidentRole->setUser($userEntity);
|
||||||
$this->entityManager->persist($leaguePresidentRole);
|
$this->entityManager->persist($leaguePresidentRole);
|
||||||
|
$this->entityManager->flush();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user