diff --git a/composer.json b/composer.json index ba62de9..9e3e861 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "type": "project", "license": "proprietary", "require": { - "php": ">=7.1.3", + "php": ">=7.4", "ext-ctype": "*", "ext-iconv": "*", "composer/package-versions-deprecated": "1.11.99.1", diff --git a/src/Controller/TasksTrackerController.php b/src/Controller/TasksTrackerController.php index f4ab2a3..5d8e535 100644 --- a/src/Controller/TasksTrackerController.php +++ b/src/Controller/TasksTrackerController.php @@ -18,11 +18,42 @@ class TasksTrackerController extends AbstractController { /** - * @Route("/olamundo/{nome}") + * @Route("/teste/{nome}") */ public function teste(string $nome): Response { - return new Response('Bem vindo :'.$nome); + $projeto = new Projeto(); + $projeto->setNome($nome); + $projeto->setDescricao("hehhehe"); + $projeto->setDtCadastro(new \DateTime()); + $projeto->setGerente("Otto"); + + $em = $this->getDoctrine()->getManager(); + $em->persist($projeto); + + + $task = new Task(); + $task ->setNome("Fazer Crud"); + $task ->setDescricao("Construir"); + $task ->setProjeto($projeto); + $task ->setDtCadastro(new \DateTime()); + $task ->setDtConclusao(new \DateTime()); + +// $status = new Status(); +// $status->setDescricao("Status"); +// $em->persist($status); + +// $status = $em->getRepository(Status::class)->find(1); +// +// $task->setStatus($status); + $em->persist($task); + $em->flush(); + + $projeto = $em->getRepository(Projeto::class)->findAll(); + + dump($projeto);exit; + + return new Response('Bem vindo :'.$nome); } } diff --git a/src/Domain/Model/Projeto.php b/src/Domain/Model/Projeto.php index 4b6b90e..a22e43c 100644 --- a/src/Domain/Model/Projeto.php +++ b/src/Domain/Model/Projeto.php @@ -8,7 +8,7 @@ /** * @ORM\Entity - * @ORM\Table(name="Projeto") + * @ORM\Table(name="projeto") */ class Projeto { @@ -27,7 +27,7 @@ class Projeto * * @ORM\Column(type="string", name="descricao") */ - private string $descircao; + private string $descricao; /** * @var string @@ -36,6 +36,13 @@ class Projeto */ private string $nome; + /** + * @var string + * + * @ORM\Column(type="string", name="gerente") + */ + private string $gerente; + /** * @var \DateTime * @@ -70,17 +77,17 @@ public function setId(int $id): void /** * @return string */ - public function getDescircao(): string + public function getDescricao(): string { - return $this->descircao; + return $this->descricao; } /** - * @param string $descircao + * @param string $descricao */ - public function setDescircao(string $descircao): void + public function setDescricao(string $descricao): void { - $this->descircao = $descircao; + $this->descricao = $descricao; } /** @@ -91,6 +98,8 @@ public function getNome(): string return $this->nome; } + + /** * @param string $nome */ @@ -123,6 +132,22 @@ public function getTasks(): Collection return $this->tasks; } + /** + * @return string + */ + public function getGerente(): string + { + return $this->gerente; + } + + /** + * @param string $gerente + */ + public function setgerente(string $gerente): void + { + $this->gerente = $gerente; + } + /** * @param ArrayCollection $tasks */ diff --git a/src/Domain/Model/Task.php b/src/Domain/Model/Task.php index 8ebef76..dd2ed62 100644 --- a/src/Domain/Model/Task.php +++ b/src/Domain/Model/Task.php @@ -33,7 +33,7 @@ class Task * * @ORM\Column(type="string", name="descricao") */ - private string $descircao; + private string $descricao; /** * @var string @@ -107,11 +107,11 @@ public function getDescircao(): string } /** - * @param string $descircao + * @param string $descricao */ - public function setDescircao(string $descircao): void + public function setDescricao(string $descricao): void { - $this->descircao = $descircao; + $this->descricao = $descricao; } /**