Created
December 7, 2013 11:49
-
-
Save gpfiel/7840219 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Admin\Entity; | |
use Doctrine\ORM\Mapping as ORM, | |
Doctrine\Common\Collections\ArrayCollection; | |
/** | |
* @ORM\Entity | |
* @ORM\Table(name="funcionario") | |
*/ | |
class Funcionario extends Usuario | |
{ | |
/** | |
* @ORM\Id | |
* @ORM\Column(name="funcionario_id", type="integer", nullable=false) | |
*/ | |
private $id; | |
/** | |
* @ORM\Column(name="profissao", type="string", nullable=false) | |
*/ | |
private $profissao; | |
/** | |
* Bidirectional - Vários funcionários são controlados por uma loja (OWNING SIDE) | |
* | |
* @ORM\ManyToOne(targetEntity="Loja", inversedBy="funcionariosAtribuidos") | |
*/ | |
private $loja; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Admin\Entity; | |
use Doctrine\ORM\Mapping as ORM, | |
Doctrine\Common\Collections\ArrayCollection; | |
/** | |
* @ORM\Entity | |
* @ORM\Table(name="loja") | |
*/ | |
class Loja extends PessoaJuridica | |
{ | |
/** | |
* @ORM\Id | |
* @ORM\Column(name="loja_id", type="integer", nullable=false) | |
*/ | |
private $id; | |
/** | |
* @ORM\Column(name="nome_fantasia", type="string", nullable=false) | |
*/ | |
private $nomeFantasia; | |
/** | |
* @ORM\Column(name="razao_social", type="string", nullable=false) | |
*/ | |
private $razaoSocial; | |
/** | |
* @ORM\OneToMany(targetEntity="Funcionario", mappedBy="loja", cascade={"persist", "remove"}) | |
* @var Funcionario[] | |
*/ | |
protected $funcionariosAtribuidos = null; | |
public function __construct() | |
{ | |
$this->funcionariosAtribuidos = new ArrayCollection(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment