microsecond submit illustration
This commit is contained in:
parent
b0db9f0dea
commit
c7daabaa5a
@ -59,7 +59,9 @@ class IllustrationController extends AbstractController
|
||||
// Initialisation de l'enregistrement
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
$data = new Entity();
|
||||
$data->setSubmittime(new DateTime());
|
||||
|
||||
$nowWithMicroseconds = DateTime::createFromFormat('U.u', sprintf('%.6F', microtime(true)));
|
||||
$data->setSubmittime($nowWithMicroseconds);
|
||||
|
||||
// Permission
|
||||
if(!$this->getUser()->hasRole("ROLE_ADMIN")&&($by=="admin"||$by=="update")) {
|
||||
@ -83,8 +85,9 @@ class IllustrationController extends AbstractController
|
||||
// Sur validation
|
||||
if ($form->get('submit')->isClicked() && $form->isValid()) {
|
||||
$data = $form->getData();
|
||||
$data->setSubmittime(new \DateTime());
|
||||
$data->setUpdatetime(new \DateTime());
|
||||
$nowWithMicroseconds = DateTime::createFromFormat('U.u', sprintf('%.6F', microtime(true)));
|
||||
$data->setSubmittime($nowWithMicroseconds);
|
||||
$data->setUpdatetime($nowWithMicroseconds);
|
||||
$em->persist($data);
|
||||
$em->flush();
|
||||
|
||||
@ -116,7 +119,8 @@ class IllustrationController extends AbstractController
|
||||
// Initialisation de l'enregistrement
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
$data = new Entity();
|
||||
$data->setSubmittime(new DateTime());
|
||||
$nowWithMicroseconds = DateTime::createFromFormat('U.u', sprintf('%.6F', microtime(true)));
|
||||
$data->setSubmittime($nowWithMicroseconds);
|
||||
|
||||
// Permission
|
||||
if(!$this->getUser()->hasRole("ROLE_ADMIN")&&($by=="admin"||$by=="update")) {
|
||||
@ -162,7 +166,8 @@ class IllustrationController extends AbstractController
|
||||
// Initialisation de l'enregistrement
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
$data = new Entity();
|
||||
$data->setSubmittime(new DateTime());
|
||||
$nowWithMicroseconds = DateTime::createFromFormat('U.u', sprintf('%.6F', microtime(true)));
|
||||
$data->setSubmittime($nowWithMicroseconds);
|
||||
|
||||
// Permission
|
||||
if(!$this->getUser()->hasRole("ROLE_ADMIN")&&($by=="admin"||$by=="update")) {
|
||||
@ -191,8 +196,9 @@ class IllustrationController extends AbstractController
|
||||
// Initialisation de l'enregistrement
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
$data = new Entity();
|
||||
$data->setSubmittime(new \DateTime());
|
||||
$data->setUpdatetime(new \DateTime());
|
||||
$nowWithMicroseconds = DateTime::createFromFormat('U.u', sprintf('%.6F', microtime(true)));
|
||||
$data->setSubmittime($nowWithMicroseconds);
|
||||
$data->setUpdatetime($nowWithMicroseconds);
|
||||
$category=$em->getRepository(Category::class)->find($categoryid);
|
||||
|
||||
// Permission
|
||||
|
@ -30,12 +30,12 @@ class Illustration
|
||||
private $description;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="datetime")
|
||||
* @ORM\Column(type="datetime", precision=6)
|
||||
*/
|
||||
private $submittime;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="datetime")
|
||||
* @ORM\Column(type="datetime", precision=6)
|
||||
*/
|
||||
private $updatetime;
|
||||
|
||||
@ -96,7 +96,6 @@ class Illustration
|
||||
public function setSubmittime(\DateTimeInterface $submittime): self
|
||||
{
|
||||
$this->submittime = $submittime;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user