Set status to draft when copying record
This commit is contained in:
@@ -7,6 +7,7 @@ use App\Entity\Collection;
|
||||
use App\Entity\Collector;
|
||||
use App\Form\BibliographyType;
|
||||
use App\Security\Voter\RecordVoter;
|
||||
use App\RecordStatus;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
@@ -123,6 +124,7 @@ class BibliographyController extends AbstractController
|
||||
);
|
||||
$copy->setCitation("{$bibliography->getCitation()} - Copy");
|
||||
$copy->setModifiedAt(new DateTimeImmutable());
|
||||
$copy->setStatus(RecordStatus::Draft->value);
|
||||
|
||||
$em->persist($copy);
|
||||
$em->flush();
|
||||
|
||||
Reference in New Issue
Block a user