YB
$em->getRepo($class)->find($id). throw Exception.Лучше в мидлварах разрулить такое
Size: a a a
YB
$em->getRepo($class)->find($id). throw Exception.Лучше в мидлварах разрулить такое
YB
VS
YB
YB
VS
VS
AA
DT
YB
DT
VS
YB
YB
DT
YB
VS
new BusinessRule($entity1, $entity2)->act()
. Ну или через DI передай в аргументы $this->busnesHandler->handle($entity1,
$entity2)
Или как нить ещёVS
$entity = $this->entityManager->getRepository(SomeClass)->...
if (null === $entitty) {
throw new Exception
}
$otherEntity = $this->entityManager->getRepository(SomeOtherClass)->...
if (null === $otherEntity) {
throw new Exception
}
this->entityManager->getRepository(SomeThirdClass)->...
$mockEntityManager->expects(self::once())->method('getRepository')->with(SomeClass)...
$mockEntityManager->expects(self::never())->method('getRepository')->with(SomeOtherClass)...
DT
VS