Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace ITW\ContactBundle\Entity;
- use Doctrine\ORM\Mapping as ORM;
- use ITW\ContactBundle\Entity\Person;
- use Doctrine\Common\Collections\ArrayCollection;
- /**
- * Contact
- *
- * @ORM\Table()
- * @ORM\Entity(repositoryClass="ITW\ContactBundle\Entity\ContactRepository")
- */
- class Contact
- {
- const REL_CUSTOMER=0;
- const REL_SUPPLIER=1;
- const REL_FRIEND=2;
- const REL_COMPETETOR=3;
- const REL_SERVICE=4;
- const REL_OTHER=5;
- /**
- * @var integer
- *
- * @ORM\Column(name="id", type="integer")
- * @ORM\Id
- * @ORM\GeneratedValue(strategy="AUTO")
- */
- private $id;
- /**
- * @var string
- *
- * @ORM\Column(name="name", type="string", length=255)
- */
- private $name;
- /**
- * @var string
- *
- * @ORM\Column(name="code", type="string", length=255)
- */
- private $code;
- /**
- * @var integer
- *
- * @ORM\Column(name="relation", type="integer")
- */
- private $relation;
- /**
- * @var string
- *
- * @ORM\Column(name="jobtype", type="string", length=255)
- */
- private $jobtype;
- /**
- * @var string
- *
- * @ORM\Column(name="machinetype", type="string", length=255)
- */
- private $machinetype;
- /**
- * @var string
- *
- * @ORM\Column(name="description", type="text",nullable=true)
- */
- private $description;
- /**
- * @var string
- *
- * @ORM\Column(name="country", type="string", length=255)
- */
- private $country;
- /**
- * @var string
- *
- * @ORM\Column(name="city", type="string", length=255)
- */
- private $city;
- /**
- * @var string
- *
- * @ORM\Column(name="address1", type="text")
- */
- private $address1;
- /**
- * @var string
- *
- * @ORM\Column(name="address2", type="text",nullable=true)
- */
- private $address2;
- /**
- * @var string
- *
- * @ORM\Column(name="fax", type="string", length=255,nullable=true)
- */
- private $fax;
- /**
- * @var string
- *
- * @ORM\Column(name="emailweb", type="string", length=255,nullable=true)
- */
- private $emailweb;
- /**
- * @var array
- *
- * @ORM\Column(name="tels", type="array")
- */
- private $tels;
- /**
- *
- * @ORM\OneToMany(targetEntity="Person", mappedBy="contact", cascade={"persist", "remove"})
- */
- private $persons;
- public function __construct()
- {
- $this->persons = new ArrayCollection();
- }
- /**
- * Get id
- *
- * @return integer
- */
- public function getId()
- {
- return $this->id;
- }
- /**
- * Set name
- *
- * @param string $name
- * @return Contact
- */
- public function setName($name)
- {
- $this->name = $name;
- return $this;
- }
- /**
- * Get name
- *
- * @return string
- */
- public function getName()
- {
- return $this->name;
- }
- /**
- * Set code
- *
- * @param string $code
- * @return Contact
- */
- public function setCode($code)
- {
- $this->code = $code;
- return $this;
- }
- /**
- * Get code
- *
- * @return string
- */
- public function getCode()
- {
- return $this->code;
- }
- /**
- * Set relation
- *
- * @param integer $relation
- * @return Contact
- */
- public function setRelation($relation)
- {
- $this->relation = $relation;
- return $this;
- }
- /**
- * Get relation
- *
- * @return integer
- */
- public function getRelation()
- {
- return $this->relation;
- }
- /**
- * Set jobtype
- *
- * @param string $jobtype
- * @return Contact
- */
- public function setJobtype($jobtype)
- {
- $this->jobtype = $jobtype;
- return $this;
- }
- /**
- * Get jobtype
- *
- * @return string
- */
- public function getJobtype()
- {
- return $this->jobtype;
- }
- /**
- * Set machinetype
- *
- * @param string $machinetype
- * @return Contact
- */
- public function setMachinetype($machinetype)
- {
- $this->machinetype = $machinetype;
- return $this;
- }
- /**
- * Get machinetype
- *
- * @return string
- */
- public function getMachinetype()
- {
- return $this->machinetype;
- }
- /**
- * Set description
- *
- * @param string $description
- * @return Contact
- */
- public function setDescription($description)
- {
- $this->description = $description;
- return $this;
- }
- /**
- * Get description
- *
- * @return string
- */
- public function getDescription()
- {
- return $this->description;
- }
- /**
- * Set country
- *
- * @param string $country
- * @return Contact
- */
- public function setCountry($country)
- {
- $this->country = $country;
- return $this;
- }
- /**
- * Get country
- *
- * @return string
- */
- public function getCountry()
- {
- return $this->country;
- }
- /**
- * Set city
- *
- * @param string $city
- * @return Contact
- */
- public function setCity($city)
- {
- $this->city = $city;
- return $this;
- }
- /**
- * Get city
- *
- * @return string
- */
- public function getCity()
- {
- return $this->city;
- }
- /**
- * Set address1
- *
- * @param string $address1
- * @return Contact
- */
- public function setAddress1($address1)
- {
- $this->address1 = $address1;
- return $this;
- }
- /**
- * Get address1
- *
- * @return string
- */
- public function getAddress1()
- {
- return $this->address1;
- }
- /**
- * Set address2
- *
- * @param string $address2
- * @return Contact
- */
- public function setAddress2($address2)
- {
- $this->address2 = $address2;
- return $this;
- }
- /**
- * Get address2
- *
- * @return string
- */
- public function getAddress2()
- {
- return $this->address2;
- }
- /**
- * Set fax
- *
- * @param string $fax
- * @return Contact
- */
- public function setFax($fax)
- {
- $this->fax = $fax;
- return $this;
- }
- /**
- * Get fax
- *
- * @return string
- */
- public function getFax()
- {
- return $this->fax;
- }
- /**
- * Set emailweb
- *
- * @param string $emailweb
- * @return Contact
- */
- public function setEmailweb($emailweb)
- {
- $this->emailweb = $emailweb;
- return $this;
- }
- /**
- * Get emailweb
- *
- * @return string
- */
- public function getEmailweb()
- {
- return $this->emailweb;
- }
- /**
- * Set tels
- *
- * @param array $tels
- * @return Contact
- */
- public function setTels($tels)
- {
- $this->tels = $tels;
- return $this;
- }
- /**
- * Get tels
- *
- * @return array
- */
- public function getTels()
- {
- return $this->tels;
- }
- /**
- * Set persons
- *
- * @param array $persons
- * @return Contact
- */
- public function setPersons($persons)
- {
- $this->persons = $persons;
- foreach ($this->persons as $p) $p->setContact($this);
- return $this;
- }
- /**
- * Get persons
- *
- * @return array
- */
- public function getPersons()
- {
- return $this->persons;
- }
- /**
- * Add persons
- *
- * @param \ITW\ContactBundle\Entity\Person $persons
- * @return Contact
- */
- public function addPersons(\ITW\ContactBundle\Entity\Person $persons)
- {
- $this->persons->add($persons);
- $persons->setContact($this);
- return $this;
- }
- /**
- * Remove persons
- *
- * @param \ITW\ContactBundle\Entity\Person $persons
- */
- public function removePersons(\ITW\ContactBundle\Entity\Person $persons)
- {
- $this->persons->removeElement($persons);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment