4r1y4n

Untitled

Nov 7th, 2014
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 8.34 KB | None | 0 0
  1. <?php
  2.  
  3. namespace ITW\ContactBundle\Entity;
  4.  
  5. use Doctrine\ORM\Mapping as ORM;
  6. use ITW\ContactBundle\Entity\Person;
  7. use Doctrine\Common\Collections\ArrayCollection;
  8. /**
  9.  * Contact
  10.  *
  11.  * @ORM\Table()
  12.  * @ORM\Entity(repositoryClass="ITW\ContactBundle\Entity\ContactRepository")
  13.  */
  14. class Contact
  15. {
  16.     const REL_CUSTOMER=0;
  17.     const REL_SUPPLIER=1;
  18.     const REL_FRIEND=2;
  19.     const REL_COMPETETOR=3;
  20.     const REL_SERVICE=4;
  21.     const REL_OTHER=5;
  22.    
  23.    
  24.     /**
  25.      * @var integer
  26.      *
  27.      * @ORM\Column(name="id", type="integer")
  28.      * @ORM\Id
  29.      * @ORM\GeneratedValue(strategy="AUTO")
  30.      */
  31.     private $id;
  32.  
  33.     /**
  34.      * @var string
  35.      *
  36.      * @ORM\Column(name="name", type="string", length=255)
  37.      */
  38.     private $name;
  39.  
  40.     /**
  41.      * @var string
  42.      *
  43.      * @ORM\Column(name="code", type="string", length=255)
  44.      */
  45.     private $code;
  46.  
  47.     /**
  48.      * @var integer
  49.      *
  50.      * @ORM\Column(name="relation", type="integer")
  51.      */
  52.     private $relation;
  53.  
  54.     /**
  55.      * @var string
  56.      *
  57.      * @ORM\Column(name="jobtype", type="string", length=255)
  58.      */
  59.     private $jobtype;
  60.  
  61.     /**
  62.      * @var string
  63.      *
  64.      * @ORM\Column(name="machinetype", type="string", length=255)
  65.      */
  66.     private $machinetype;
  67.  
  68.     /**
  69.      * @var string
  70.      *
  71.      * @ORM\Column(name="description", type="text",nullable=true)
  72.      */
  73.     private $description;
  74.  
  75.     /**
  76.      * @var string
  77.      *
  78.      * @ORM\Column(name="country", type="string", length=255)
  79.      */
  80.     private $country;
  81.  
  82.     /**
  83.      * @var string
  84.      *
  85.      * @ORM\Column(name="city", type="string", length=255)
  86.      */
  87.     private $city;
  88.  
  89.     /**
  90.      * @var string
  91.      *
  92.      * @ORM\Column(name="address1", type="text")
  93.      */
  94.     private $address1;
  95.  
  96.     /**
  97.      * @var string
  98.      *
  99.      * @ORM\Column(name="address2", type="text",nullable=true)
  100.      */
  101.     private $address2;
  102.  
  103.     /**
  104.      * @var string
  105.      *
  106.      * @ORM\Column(name="fax", type="string", length=255,nullable=true)
  107.      */
  108.     private $fax;
  109.  
  110.     /**
  111.      * @var string
  112.      *
  113.      * @ORM\Column(name="emailweb", type="string", length=255,nullable=true)
  114.      */
  115.     private $emailweb;
  116.  
  117.     /**
  118.      * @var array
  119.      *
  120.      * @ORM\Column(name="tels", type="array")
  121.      */
  122.     private $tels;
  123.  
  124.     /**
  125.      *
  126.      * @ORM\OneToMany(targetEntity="Person", mappedBy="contact", cascade={"persist", "remove"})
  127.      */
  128.     private $persons;
  129.  
  130.     public function __construct()
  131.     {
  132.         $this->persons = new ArrayCollection();
  133.     }
  134.    
  135.     /**
  136.      * Get id
  137.      *
  138.      * @return integer
  139.      */
  140.     public function getId()
  141.     {
  142.         return $this->id;
  143.     }
  144.  
  145.     /**
  146.      * Set name
  147.      *
  148.      * @param string $name
  149.      * @return Contact
  150.      */
  151.     public function setName($name)
  152.     {
  153.         $this->name = $name;
  154.        
  155.         return $this;
  156.     }
  157.  
  158.     /**
  159.      * Get name
  160.      *
  161.      * @return string
  162.      */
  163.     public function getName()
  164.     {
  165.         return $this->name;
  166.     }
  167.  
  168.     /**
  169.      * Set code
  170.      *
  171.      * @param string $code
  172.      * @return Contact
  173.      */
  174.     public function setCode($code)
  175.     {
  176.         $this->code = $code;
  177.  
  178.         return $this;
  179.     }
  180.  
  181.     /**
  182.      * Get code
  183.      *
  184.      * @return string
  185.      */
  186.     public function getCode()
  187.     {
  188.         return $this->code;
  189.     }
  190.  
  191.     /**
  192.      * Set relation
  193.      *
  194.      * @param integer $relation
  195.      * @return Contact
  196.      */
  197.     public function setRelation($relation)
  198.     {
  199.         $this->relation = $relation;
  200.  
  201.         return $this;
  202.     }
  203.  
  204.     /**
  205.      * Get relation
  206.      *
  207.      * @return integer
  208.      */
  209.     public function getRelation()
  210.     {
  211.         return $this->relation;
  212.     }
  213.  
  214.     /**
  215.      * Set jobtype
  216.      *
  217.      * @param string $jobtype
  218.      * @return Contact
  219.      */
  220.     public function setJobtype($jobtype)
  221.     {
  222.         $this->jobtype = $jobtype;
  223.  
  224.         return $this;
  225.     }
  226.  
  227.     /**
  228.      * Get jobtype
  229.      *
  230.      * @return string
  231.      */
  232.     public function getJobtype()
  233.     {
  234.         return $this->jobtype;
  235.     }
  236.  
  237.     /**
  238.      * Set machinetype
  239.      *
  240.      * @param string $machinetype
  241.      * @return Contact
  242.      */
  243.     public function setMachinetype($machinetype)
  244.     {
  245.         $this->machinetype = $machinetype;
  246.  
  247.         return $this;
  248.     }
  249.  
  250.     /**
  251.      * Get machinetype
  252.      *
  253.      * @return string
  254.      */
  255.     public function getMachinetype()
  256.     {
  257.         return $this->machinetype;
  258.     }
  259.  
  260.     /**
  261.      * Set description
  262.      *
  263.      * @param string $description
  264.      * @return Contact
  265.      */
  266.     public function setDescription($description)
  267.     {
  268.         $this->description = $description;
  269.  
  270.         return $this;
  271.     }
  272.  
  273.     /**
  274.      * Get description
  275.      *
  276.      * @return string
  277.      */
  278.     public function getDescription()
  279.     {
  280.         return $this->description;
  281.     }
  282.  
  283.     /**
  284.      * Set country
  285.      *
  286.      * @param string $country
  287.      * @return Contact
  288.      */
  289.     public function setCountry($country)
  290.     {
  291.         $this->country = $country;
  292.  
  293.         return $this;
  294.     }
  295.  
  296.     /**
  297.      * Get country
  298.      *
  299.      * @return string
  300.      */
  301.     public function getCountry()
  302.     {
  303.         return $this->country;
  304.     }
  305.  
  306.     /**
  307.      * Set city
  308.      *
  309.      * @param string $city
  310.      * @return Contact
  311.      */
  312.     public function setCity($city)
  313.     {
  314.         $this->city = $city;
  315.  
  316.         return $this;
  317.     }
  318.  
  319.     /**
  320.      * Get city
  321.      *
  322.      * @return string
  323.      */
  324.     public function getCity()
  325.     {
  326.         return $this->city;
  327.     }
  328.  
  329.     /**
  330.      * Set address1
  331.      *
  332.      * @param string $address1
  333.      * @return Contact
  334.      */
  335.     public function setAddress1($address1)
  336.     {
  337.         $this->address1 = $address1;
  338.  
  339.         return $this;
  340.     }
  341.  
  342.     /**
  343.      * Get address1
  344.      *
  345.      * @return string
  346.      */
  347.     public function getAddress1()
  348.     {
  349.         return $this->address1;
  350.     }
  351.  
  352.     /**
  353.      * Set address2
  354.      *
  355.      * @param string $address2
  356.      * @return Contact
  357.      */
  358.     public function setAddress2($address2)
  359.     {
  360.         $this->address2 = $address2;
  361.  
  362.         return $this;
  363.     }
  364.  
  365.     /**
  366.      * Get address2
  367.      *
  368.      * @return string
  369.      */
  370.     public function getAddress2()
  371.     {
  372.         return $this->address2;
  373.     }
  374.  
  375.     /**
  376.      * Set fax
  377.      *
  378.      * @param string $fax
  379.      * @return Contact
  380.      */
  381.     public function setFax($fax)
  382.     {
  383.         $this->fax = $fax;
  384.  
  385.         return $this;
  386.     }
  387.  
  388.     /**
  389.      * Get fax
  390.      *
  391.      * @return string
  392.      */
  393.     public function getFax()
  394.     {
  395.         return $this->fax;
  396.     }
  397.  
  398.     /**
  399.      * Set emailweb
  400.      *
  401.      * @param string $emailweb
  402.      * @return Contact
  403.      */
  404.     public function setEmailweb($emailweb)
  405.     {
  406.         $this->emailweb = $emailweb;
  407.  
  408.         return $this;
  409.     }
  410.  
  411.     /**
  412.      * Get emailweb
  413.      *
  414.      * @return string
  415.      */
  416.     public function getEmailweb()
  417.     {
  418.         return $this->emailweb;
  419.     }
  420.  
  421.     /**
  422.      * Set tels
  423.      *
  424.      * @param array $tels
  425.      * @return Contact
  426.      */
  427.     public function setTels($tels)
  428.     {
  429.         $this->tels = $tels;
  430.  
  431.         return $this;
  432.     }
  433.  
  434.     /**
  435.      * Get tels
  436.      *
  437.      * @return array
  438.      */
  439.     public function getTels()
  440.     {
  441.         return $this->tels;
  442.     }
  443.  
  444.     /**
  445.      * Set persons
  446.      *
  447.      * @param array $persons
  448.      * @return Contact
  449.      */
  450.     public function setPersons($persons)
  451.     {
  452.         $this->persons = $persons;
  453.     foreach ($this->persons as $p) $p->setContact($this);
  454.        
  455.         return $this;
  456.     }
  457.  
  458.     /**
  459.      * Get persons
  460.      *
  461.      * @return array
  462.      */
  463.     public function getPersons()
  464.     {
  465.         return $this->persons;
  466.     }
  467.  
  468.     /**
  469.      * Add persons
  470.      *
  471.      * @param \ITW\ContactBundle\Entity\Person $persons
  472.      * @return Contact
  473.      */
  474.     public function addPersons(\ITW\ContactBundle\Entity\Person $persons)
  475.     {
  476.         $this->persons->add($persons);
  477.     $persons->setContact($this);
  478.         return $this;
  479.     }
  480.  
  481.     /**
  482.      * Remove persons
  483.      *
  484.      * @param \ITW\ContactBundle\Entity\Person $persons
  485.      */
  486.     public function removePersons(\ITW\ContactBundle\Entity\Person $persons)
  487.     {
  488.         $this->persons->removeElement($persons);
  489.     }
  490. }
Advertisement
Add Comment
Please, Sign In to add comment