コード例 #1
0
 function it_handles_a_delete_command(Entity $entity, Delete $command, EntityManagerInterface $em)
 {
     $command->getEntity()->willReturn($entity);
     $em->remove($entity)->shouldBeCalled();
     $em->flush()->shouldBeCalled();
     $this->handle($command);
 }
コード例 #2
0
ファイル: Remover.php プロジェクト: indigophp/crud-doctrine
 /**
  * Removes an entity
  *
  * @param Delete $command
  */
 public function handle(Delete $command)
 {
     $entity = $command->getEntity();
     $this->em->remove($entity);
     $this->em->flush();
 }