Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
35 changes: 33 additions & 2 deletions src/Controller/TasksTrackerController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

}
39 changes: 32 additions & 7 deletions src/Domain/Model/Projeto.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

/**
* @ORM\Entity
* @ORM\Table(name="Projeto")
* @ORM\Table(name="projeto")
*/
class Projeto
{
Expand All @@ -27,7 +27,7 @@ class Projeto
*
* @ORM\Column(type="string", name="descricao")
*/
private string $descircao;
private string $descricao;

/**
* @var string
Expand All @@ -36,6 +36,13 @@ class Projeto
*/
private string $nome;

/**
* @var string
*
* @ORM\Column(type="string", name="gerente")
*/
private string $gerente;

/**
* @var \DateTime
*
Expand Down Expand Up @@ -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;
}

/**
Expand All @@ -91,6 +98,8 @@ public function getNome(): string
return $this->nome;
}



/**
* @param string $nome
*/
Expand Down Expand Up @@ -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
*/
Expand Down
8 changes: 4 additions & 4 deletions src/Domain/Model/Task.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class Task
*
* @ORM\Column(type="string", name="descricao")
*/
private string $descircao;
private string $descricao;

/**
* @var string
Expand Down Expand Up @@ -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;
}

/**
Expand Down