Skip to content

Instantly share code, notes, and snippets.

View andrechavesg's full-sized avatar
🐫
Camelando

André Chaves andrechavesg

🐫
Camelando
View GitHub Profile
@andrechavesg
andrechavesg / gist:a1018c2a0b964f79d3fd21d09cca5107
Created March 12, 2018 15:48
mapeamento Funcionario-Projeto
/**
* @OneToMany(targetEntity="Funcionario", mappedBy="Projeto")
*/
private $funcionarios;
<?php
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity
*/
class Projeto
<?php
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity
*/
class Funcionario
<?php
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity
*/
class HoraLancada
<?php
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity
*/
class Funcionario
<?php
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity
*/
class Projeto
/**
* @Route("/projeto/mostra/{id}")
*/
public function mostraAction(Projeto $projeto)
{
return $this->render('Projeto/mostra.html.twig',["projeto" => $projeto]);
}
/**
* @Route("/projeto/novo",methods="GET")
<?php
namespace App\Controller;
use App\Entity\Funcionario;
use App\Entity\Usuario;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Routing\Annotation\Route;
{% extends 'base.html.twig' %}
{% block stylesheets %}
<style>
h1 {
font-size: 50px !important;
}
</style>
{% endblock %}
{% block body %}
<div class="row">
{% extends 'base.html.twig' %}
{% block body %}
<div class="panel panel-default">
<div class="panel-heading">
Usuario
</div>
<!-- /.panel-heading -->
<div class="panel-body">
<div class="table-responsive">
<table class="table table-hover">