Last active
December 19, 2015 13:09
-
-
Save fatorx/5960014 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 Imoveis\Entity; | |
use Doctrine\ORM\Mapping as ORM; | |
use Zend\Stdlib\Hydrator; | |
/** | |
* Bairros | |
* | |
* @ORM\Table(name="bairros") | |
* @ORM\Entity | |
* @ORM\Entity(repositoryClass="Imoveis\Entity\BairroRepository") | |
*/ | |
class Bairro | |
{ | |
/** | |
* @var integer | |
* | |
* @ORM\Column(name="id", type="integer", nullable=false) | |
* @ORM\Id | |
* @ORM\GeneratedValue(strategy="IDENTITY") | |
*/ | |
private $id; | |
/** | |
* @var string | |
* | |
* @ORM\Column(name="nome", type="string", length=45, nullable=true) | |
*/ | |
private $nome; | |
public function __construct(array $options = array()) | |
{ | |
$hydrator = new Hydrator\ClassMethods(); | |
$hydrator->hydrate($options, $this); | |
} | |
public function getId() | |
{ | |
return $this->id; | |
} | |
public function setId($id) | |
{ | |
$this->id = $id; | |
return $this; | |
} | |
public function getNome() | |
{ | |
return $this->nome; | |
} | |
public function setNome($nome) | |
{ | |
$this->nome = $nome; | |
return $this; | |
} | |
public function toArray() | |
{ | |
$hydrator = new Hydrator\ClassMethods(); | |
return $hydrator->extract($this); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment