milardovich

Moparman » Symfony » Contact Entity

Mar 2nd, 2015
326
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 4.61 KB | None | 0 0
  1. <?php
  2.  
  3. namespace MDOAgendaMoparmanBundle\Entity;
  4.  
  5. use Doctrine\ORM\Mapping as ORM;
  6.  
  7. /**
  8.  * Contact
  9.  */
  10. class Contact
  11. {
  12.     /**
  13.      * @var integer
  14.      */
  15.     private $id;
  16.  
  17.     /**
  18.      * @var string
  19.      */
  20.     private $name;
  21.  
  22.     /**
  23.      * @var string
  24.      */
  25.     private $email;
  26.  
  27.     /**
  28.      * @var string
  29.      */
  30.     private $phone;
  31.  
  32.     /**
  33.      * @var string
  34.      */
  35.     private $city;
  36.  
  37.     /**
  38.      * @var string
  39.      */
  40.     private $notes;
  41.  
  42.     /**
  43.      * @var string
  44.      */
  45.     private $photo;
  46.  
  47.     /**
  48.      * @ORM\ManyToMany(targetEntity="Category", inversedBy="contacts")
  49.      * @ORM\JoinColumn(name="category_id", referencedColumnName="id")
  50.      */
  51.     private $categories;
  52.  
  53.  
  54.     /**
  55.      * Get id
  56.      *
  57.      * @return integer
  58.      */
  59.     public function getId()
  60.     {
  61.         return $this->id;
  62.     }
  63.  
  64.     /**
  65.      * Set name
  66.      *
  67.      * @param string $name
  68.      * @return Contact
  69.      */
  70.     public function setName($name)
  71.     {
  72.         $this->name = $name;
  73.  
  74.         return $this;
  75.     }
  76.  
  77.     /**
  78.      * Get name
  79.      *
  80.      * @return string
  81.      */
  82.     public function getName()
  83.     {
  84.         return $this->name;
  85.     }
  86.  
  87.     /**
  88.      * Set email
  89.      *
  90.      * @param string $email
  91.      * @return Contact
  92.      */
  93.     public function setEmail($email)
  94.     {
  95.         $this->email = $email;
  96.  
  97.         return $this;
  98.     }
  99.  
  100.     /**
  101.      * Get email
  102.      *
  103.      * @return string
  104.      */
  105.     public function getEmail()
  106.     {
  107.         return $this->email;
  108.     }
  109.  
  110.     /**
  111.      * Set phone
  112.      *
  113.      * @param string $phone
  114.      * @return Contact
  115.      */
  116.     public function setPhone($phone)
  117.     {
  118.         $this->phone = $phone;
  119.  
  120.         return $this;
  121.     }
  122.  
  123.     /**
  124.      * Get phone
  125.      *
  126.      * @return string
  127.      */
  128.     public function getPhone()
  129.     {
  130.         return $this->phone;
  131.     }
  132.  
  133.     /**
  134.      * Set city
  135.      *
  136.      * @param string $city
  137.      * @return Contact
  138.      */
  139.     public function setCity($city)
  140.     {
  141.         $this->city = $city;
  142.  
  143.         return $this;
  144.     }
  145.  
  146.     /**
  147.      * Get city
  148.      *
  149.      * @return string
  150.      */
  151.     public function getCity()
  152.     {
  153.         return $this->city;
  154.     }
  155.  
  156.     /**
  157.      * Set notes
  158.      *
  159.      * @param string $notes
  160.      * @return Contact
  161.      */
  162.     public function setNotes($notes)
  163.     {
  164.         $this->notes = $notes;
  165.  
  166.         return $this;
  167.     }
  168.  
  169.     /**
  170.      * Get notes
  171.      *
  172.      * @return string
  173.      */
  174.     public function getNotes()
  175.     {
  176.         return $this->notes;
  177.     }
  178.  
  179.     /**
  180.      * Set photo
  181.      *
  182.      * @param string $photo
  183.      * @return Contact
  184.      */
  185.     public function setPhoto($photo)
  186.     {
  187.         $this->photo = $photo;
  188.  
  189.         return $this;
  190.     }
  191.  
  192.     /**
  193.      * Get photo
  194.      *
  195.      * @return string
  196.      */
  197.     public function getPhoto()
  198.     {
  199.         return $this->photo;
  200.     }
  201.  
  202.     /**
  203.      * Set categories
  204.      *
  205.      * @param array $categories
  206.      * @return Contact
  207.      */
  208.     public function setCategories($categories)
  209.     {
  210.         $this->categories = $categories;
  211.  
  212.         return $this;
  213.     }
  214.  
  215.     /**
  216.      * Get categories
  217.      *
  218.      * @return array
  219.      */
  220.     public function getCategories()
  221.     {
  222.         return $this->categories;
  223.     }
  224.     /**
  225.      * @var \MDOAgendaMoparmanBundle\Entity\Category
  226.      */
  227.     private $category;
  228.  
  229.  
  230.     /**
  231.      * Set category
  232.      *
  233.      * @param \MDOAgendaMoparmanBundle\Entity\Category $category
  234.      * @return Contact
  235.      */
  236.     public function setCategory(\MDOAgendaMoparmanBundle\Entity\Category $category = null)
  237.     {
  238.         $this->category = $category;
  239.  
  240.         return $this;
  241.     }
  242.  
  243.     /**
  244.      * Get category
  245.      *
  246.      * @return \MDOAgendaMoparmanBundle\Entity\Category
  247.      */
  248.     public function getCategory()
  249.     {
  250.         return $this->category;
  251.     }
  252.     /**
  253.      * Constructor
  254.      */
  255.     public function __construct()
  256.     {
  257.         $this->category = new \Doctrine\Common\Collections\ArrayCollection();
  258.     }
  259.  
  260.     /**
  261.      * Add category
  262.      *
  263.      * @param \MDOAgendaMoparmanBundle\Entity\Category $category
  264.      * @return Contact
  265.      */
  266.     public function addCategory(\MDOAgendaMoparmanBundle\Entity\Category $category)
  267.     {
  268.         $this->category[] = $category;
  269.  
  270.         return $this;
  271.     }
  272.  
  273.     /**
  274.      * Remove category
  275.      *
  276.      * @param \MDOAgendaMoparmanBundle\Entity\Category $category
  277.      */
  278.     public function removeCategory(\MDOAgendaMoparmanBundle\Entity\Category $category)
  279.     {
  280.         $this->category->removeElement($category);
  281.     }
  282. }
Advertisement
Add Comment
Please, Sign In to add comment