Skip to content

Instantly share code, notes, and snippets.

@jorgeguberte
Created September 30, 2015 17:29
Show Gist options
  • Save jorgeguberte/74ebee55f408af2071c5 to your computer and use it in GitHub Desktop.
Save jorgeguberte/74ebee55f408af2071c5 to your computer and use it in GitHub Desktop.
<?php
namespace Entity;
/**
* User Model
*
* @Entity
* @Table(name="fornecedor")
*/
class Fornecedor
{
/**
* @Id
* @Column(type="integer", nullable=false)
* @GeneratedValue(strategy="AUTO")
*/
protected $id;
/**
* @OneToMany(targetEntity="Produto", mappedBy="fornecedor_ir")
*/
protected $produtos;
/**
* @Column(type="string", length=100, nullable=false)
*/
protected $nome;
/**
* @Column(type="datetime", nullable=false)
*/
protected $dataCadastro;
/**
* @Column(type="boolean")
*/
protected $status;
/**
* @Column(type="string", length=200)
*/
protected $codigo;
public function __construct(){
$this->produtos = new ArrayCollection;
}
public function setCodigo($codigo){
$this->codigo = $codigo;
return $this;
}
public function setNome($nome)
{
$this->nome = $nome;
return $this;
}
public function setDataCadastro($dataCadastro)
{
$this->dataCadastro = $dataCadastro;
return $this;
}
public function setStatus($status){
$this->status = $status;
return $this;
}
public function getId()
{
return $this->id;
}
public function getCodigo(){
return $this->codigo;
}
public function getNome()
{
return $this->nome;
}
public function getDataCadastro()
{
return $this->dataCadastro;
}
public function getStatus()
{
return $this->status;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment