Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace Nvia\CommonBundle\Entity;
- use Doctrine\ORM\Mapping as ORM;
- use JMS\Serializer\Annotation\Exclude;
- use JMS\Serializer\Annotation\ExclusionPolicy;
- use JMS\Serializer\Annotation\Expose;
- /**
- * Country
- *
- * @ORM\Table(name="country")
- * @ORM\Entity(repositoryClass="Nvia\CommonBundle\Entity\Repository\CountryRepository")
- * @ExclusionPolicy("all")
- */
- class Country
- {
- /**
- * @var string
- *
- * @ORM\Column(name="id", type="string", length=3)
- * @ORM\Id
- * @ORM\GeneratedValue(strategy="NONE")
- * @Expose
- */
- private $id;
- /**
- * @var string
- *
- * @ORM\Column(name="name", type="string", length=45, nullable=false)
- * @Expose
- */
- private $name;
- /**
- * @var \Nvia\CommonBundle\Entity\Currency
- *
- * @ORM\ManyToOne(targetEntity="Nvia\CommonBundle\Entity\Currency")
- * @ORM\JoinColumn(name="currency_id", referencedColumnName="id", nullable=false)
- */
- private $currency;
- /**
- * @var \Nvia\CommonBundle\Entity\Language
- *
- * @ORM\ManyToOne(targetEntity="Nvia\CommonBundle\Entity\Language")
- * @ORM\JoinColumn(name="language_id", referencedColumnName="id", nullable=false)
- */
- private $language;
- /**
- * @var \DateTime
- *
- * @ORM\Column(name="created_at", type="datetime", nullable=false)
- * @Exclude
- */
- private $createdAt;
- function __construct($id)
- {
- $this->createdAt = new \DateTime('now');
- $this->id = $id;
- }
- public function __toString()
- {
- return $this->name;
- }
- /**
- * Set name
- *
- * @param string $name
- * @return Country
- */
- public function setName($name)
- {
- $this->name = $name;
- return $this;
- }
- /**
- * Get name
- *
- * @return string
- */
- public function getName()
- {
- return $this->name;
- }
- /**
- * Get id
- *
- * @return string
- */
- public function getId()
- {
- return $this->id;
- }
- /**
- * Set currency
- *
- * @param \Nvia\CommonBundle\Entity\Currency $currency
- * @return Country
- */
- public function setCurrency(\Nvia\CommonBundle\Entity\Currency $currency = null)
- {
- $this->currency = $currency;
- return $this;
- }
- /**
- * Get currency
- *
- * @return \Nvia\CommonBundle\Entity\Currency
- */
- public function getCurrency()
- {
- return $this->currency;
- }
- /**
- * Set language
- *
- * @param \Nvia\CommonBundle\Entity\Language $language
- * @return Country
- */
- public function setLanguage(\Nvia\CommonBundle\Entity\Language $language = null)
- {
- $this->language = $language;
- return $this;
- }
- /**
- * Get language
- *
- * @return \Nvia\CommonBundle\Entity\Language
- */
- public function getLanguage()
- {
- return $this->language;
- }
- /**
- * Set createdAt
- *
- * @param \DateTime $createdAt
- * @return Country
- */
- private function setCreatedAt($createdAt)
- {
- $this->createdAt = $createdAt;
- return $this;
- }
- /**
- * Get createdAt
- *
- * @return \DateTime
- */
- public function getCreatedAt()
- {
- return $this->createdAt;
- }
- /**
- * Set id
- *
- * @param string $id
- * @return Country
- */
- private function setId($id)
- {
- $this->id = $id;
- return $this;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement