Skip to content

Instantly share code, notes, and snippets.

@EloneSampaio
Created March 10, 2018 20:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save EloneSampaio/83cb6668d25a198b481a5ef675220720 to your computer and use it in GitHub Desktop.
Save EloneSampaio/83cb6668d25a198b481a5ef675220720 to your computer and use it in GitHub Desktop.
<?php
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
/**
* @ORM\Entity(repositoryClass="App\Repository\CargoRepository")
*/
class Cargo
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
// add your own fields
/**
* @ORM\Column(type="string", length=100)
* @Assert\NotBlank()
*/
private $nome;
public function __toString()
{
return $this->getNome();
}
/**
* @return mixed
*/
public function getId()
{
return $this->id;
}
/**
* @param mixed $id
*/
public function setId($id)
{
$this->id = $id;
}
/**
* @return mixed
*/
public function getNome()
{
return $this->nome;
}
/**
* @param mixed $nome
*/
public function setNome($nome)
{
$this->nome = $nome;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment