src/project/OfficeBrain/CustomBundle/UserBundle/Entity/ContactBook.php line 26

Open in your IDE?
  1. <?php
  2. namespace App\project\OfficeBrain\CustomBundle\UserBundle\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use Gedmo\Mapping\Annotation as GEDMO;
  5. use Symfony\Component\Validator\Constraints as Assert;
  6. use JMS\Serializer\Annotation\ExclusionPolicy;
  7. use JMS\Serializer\Annotation\Exclude;
  8. /**
  9.  * Entity For Contact Book
  10.  * @author OfficeBrain 4493
  11.  */
  12. /**
  13.  * ContactBook
  14.  *
  15.  * @ORM\Table(name="tbl_user_contact_book")
  16.  * @ORM\Entity(repositoryClass="App\project\OfficeBrain\CustomBundle\UserBundle\Entity\ContactBookRepository")
  17.  * @Gedmo\SoftDeleteable(fieldName="deletedAt", timeAware=false)
  18.  * @ExclusionPolicy("none")
  19.  */
  20. class ContactBook
  21. {
  22.     /**
  23.      * @var integer
  24.      *
  25.      * @ORM\Column(name="id", type="bigint", length=20, options={"unsigned"=true})
  26.      * @ORM\Id
  27.      * @ORM\GeneratedValue(strategy="AUTO")
  28.      */
  29.     private $id;
  30.     // @ORM\ManyToOne(targetEntity="\App\project\OfficeBrain\CustomBundle\UserBundle\Entity\User", inversedBy="contactBook")
  31.     /**
  32.      * @var integer
  33.      * @ORM\ManyToOne(targetEntity="\App\OfficeBrain\Bundle\UserBundle\Entity\User", inversedBy="contactBook")
  34.      * @ORM\JoinColumn(name="user_id",referencedColumnName="id")
  35.      */
  36.     private $user;
  37.     /**
  38.      * @var string
  39.      * @ORM\Column(name="name", type="string", length=100, options={"collate"="utf8_unicode_ci"},nullable=true)
  40.      * @Assert\NotBlank(message = "user.contact_book.name.not_blank")
  41.      * @Assert\Regex(pattern="/^[A-Za-z_\-'\s]+$/",   match=true,   message="user.contact_book.name.not_valid" )
  42.      */
  43.     private $name;
  44.     /**
  45.      * @var integer
  46.      * @ORM\ManyToOne(targetEntity="\App\OfficeBrain\Bundle\CoreBundle\Entity\AddressType", inversedBy="contactBook")
  47.      * @ORM\JoinColumn(name="adress_type",referencedColumnName="id")
  48.      * @Assert\NotBlank(message = "user.contact_book.addressType.not_blank")
  49.      */
  50.     private $adressType;
  51.     /**
  52.      * @var string
  53.      *
  54.      * @ORM\Column(name="email", type="string",  length=100, options={"collate"="utf8_unicode_ci"},nullable=true)
  55.      * @Assert\NotBlank(message = "user.contact_book.email.not_blank")     
  56.      * @Assert\Regex(
  57.      *   pattern="/^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$/",
  58.      *   match=true,
  59.      *   message="user.contact_book.email.not_valid"
  60.      * )
  61.      */
  62.     private $email;
  63.     
  64.     /**
  65.      * @var string
  66.      *
  67.      * @ORM\Column(name="company_name", type="string", length=255, options={"collate"="utf8_unicode_ci"} ,nullable=true)
  68.      */
  69.     private $companyName;
  70.     
  71.     /**
  72.      * @var string
  73.      *
  74.      * @ORM\Column(name="company_number", type="string", length=255, options={"collate"="utf8_unicode_ci"} ,nullable=true)
  75.      */
  76.     private $companyNumber;
  77.     
  78.     /**
  79.      * @var string
  80.      *
  81.      * @ORM\Column(name="street1", type="text", options={"collate"="utf8_unicode_ci"}, nullable=true)
  82.      * @Assert\NotBlank(message = "user.contact_book.street1.not_blank")
  83.      */
  84.     private $street1;
  85.     /**
  86.      * @var string
  87.      * @ORM\Column(name="street2", type="text", options={"collate"="utf8_unicode_ci"}, nullable=true)
  88.      */
  89.     private $street2;
  90.     /**
  91.      * @var integer
  92.      *
  93.      * @ORM\Column(name="country_id", type="bigint", length=20,options={"unsigned"=true},nullable=true)
  94.      * @Assert\NotBlank(message = "user.contact_book.countryId.not_blank")
  95.      */
  96.     private $countryId;
  97.     /**
  98.      * @var integer
  99.      *
  100.      * @ORM\Column(name="state_id", type="bigint", length=20,options={"unsigned"=true},nullable=true)
  101.      * 
  102.      */
  103.     private $stateId;
  104.     /**
  105.      * @var integer
  106.      *
  107.      * @ORM\Column(name="city_id", type="bigint", length=20,options={"unsigned"=true},nullable=true)
  108.      */
  109.     private $cityId;
  110.     /**
  111.      * @var string
  112.      *
  113.      * @ORM\Column(name="zipcode", type="string",  length=50, options={"collate"="utf8_unicode_ci"},nullable=true)
  114.      */
  115.     private $zipcode;
  116.     /**
  117.      * @var string
  118.      *
  119.      * @ORM\Column(name="extension", type="string",  length=50, options={"collate"="utf8_nicode_ci"},nullable=true)
  120.      * @Assert\Length(max = 8, maxMessage = "user.contact_book.extension.max_length" )
  121.      * @Assert\Regex(pattern="/^[0-9]+$/",   match=true,   message="user.contact_book.extension.not_valid" )
  122.      */
  123.     private $extension;
  124.     /**
  125.      * @var string
  126.      *
  127.      * @ORM\Column(name="phone", type="string",  length=50, options={"collate"="utf8_unicode_ci"},nullable=true)
  128.      * @Assert\Length(min=12, minMessage="user.contact_book.phone.invalid")
  129.      * @Assert\Regex(pattern="/^[0-9-\+]+$/",   match=true,   message="user.contact_book.phone.not_valid" )
  130.      */
  131.     private $phone;
  132.     /**
  133.      * @var string
  134.      *
  135.      * @ORM\Column(name="mobile", type="string",  length=50, options={"collate"="utf8_unicode_ci"},nullable=true)
  136.      * @Assert\Length(min=12, minMessage="user.contact_book.mobile.invalid")
  137.      * @Assert\Regex(pattern="/^[0-9-\+]+$/",   match=true,   message="user.contact_book.mobile.not_valid" )
  138.      */
  139.     private $mobile;
  140.     /**
  141.      * @var string
  142.      *
  143.      * @ORM\Column(name="fax", type="string",  length=100, options={"collate"="utf8_unicode_ci"},nullable=true)
  144.      * @Assert\Length(min=12, minMessage="user.contact_book.fax.invalid")
  145.      * @Assert\Regex(pattern="/^[0-9\-]+$/",   match=true,   message="user.contact_book.fax.not_valid" )
  146.      */
  147.     private $fax;
  148.     /**
  149.      * @var string
  150.      *
  151.      * @ORM\Column(name="website", type="string",  length=100, options={"collate"="utf8_unicode_ci"},nullable=true)     
  152.      * @Assert\Regex(pattern="/^(https?:\/\/|http?:\/\/|HTTPS?:\/\/|HTTP?:\/\/)?([\da-zA-Z\.-]+)\.([a-zA-Z\.]{2,6})([\/\w \.-]*)*\/?$/",   match=true,   message="user.contact_book.website.not_valid" )
  153.      */
  154.     private $website;
  155.     /**
  156.      * @var integer
  157.      *
  158.      * @ORM\Column(name="erp_id", type="bigint" ,length=20 ,options={"unsigned"=true},nullable=true)
  159.      */
  160.     private $erpId;
  161.     
  162.     /**
  163.      * @var integer
  164.      *
  165.      * @ORM\Column(name="is_address", type="bigint" ,length=20 ,options={"unsigned"=true},nullable=true)
  166.      */
  167.     private $isAddress;
  168.     
  169.     /**
  170.      * @var integer
  171.      *
  172.      * @ORM\Column(name="is_office", type="bigint", length=20 ,options={"unsigned"=true},nullable=true)
  173.      */
  174.     private $isOffice;
  175.     
  176.     
  177.     /**
  178.      * @var integer
  179.      *
  180.      * @ORM\Column(name="is_default", type="bigint" ,length=20 ,options={"unsigned"=true},nullable=true)
  181.      */
  182.     private $isDefault;
  183.     
  184.     /**
  185.      * @var datetime
  186.      *
  187.      * @Gedmo\Timestampable(on="create")
  188.      * @ORM\Column(name="created_at",type="datetime",nullable=true)
  189.      */
  190.     protected $createdAt;
  191.     /**
  192.      * @var datetime
  193.      *
  194.      * @Gedmo\Timestampable(on="update")
  195.      * @ORM\Column( name="updated_at", type="datetime",nullable=true)
  196.      */
  197.     protected $updatedAt;
  198.     /**
  199.      * @var datetime
  200.      *
  201.      * @ORM\Column(name="deleted_at",type="datetime",  nullable=true)
  202.      */
  203.     protected $deletedAt;
  204.     /**
  205.      * @var integer
  206.      * @ORM\Column(name="created_uid", type="bigint" ,length=20 ,options={"unsigned"=true},nullable=true)
  207.      */
  208.     private $createdUid;
  209.     /**
  210.      * @var integer
  211.      * @ORM\Column(name="updated_uid", type="bigint" ,length=20 ,options={"unsigned"=true},nullable=true)
  212.      */
  213.     private $updatedUid;
  214.     /**
  215.      * @var integer
  216.      * @ORM\Column(name="deleted_uid", type="bigint" ,length=20 ,options={"unsigned"=true},nullable=true)
  217.      */
  218.     private $deletedUid;
  219.     
  220.     /**
  221.      * @var string
  222.      * @ORM\Column(name="other_country", type="string", length=255, options={"collate"="utf8_unicode_ci"}, nullable=true)
  223.      */
  224.     private $otherCountry;
  225.     /**
  226.      * Get id
  227.      *
  228.      * @return integer
  229.      */
  230.     public function getId()
  231.     {
  232.         return $this->id;
  233.     }
  234.     /**
  235.      * Set name
  236.      *
  237.      * @param string $name
  238.      * @return ContactBook
  239.      */
  240.     public function setName($name)
  241.     {
  242.         $this->name $name;
  243.         return $this;
  244.     }
  245.     /**
  246.      * Get name
  247.      *
  248.      * @return string
  249.      */
  250.     public function getName()
  251.     {
  252.         return $this->name;
  253.     }
  254.     /**
  255.      * Set adressType
  256.      *
  257.      * @param string $adressType
  258.      * @return ContactBook
  259.      */
  260.     public function setAdressType($adressType)
  261.     {
  262.         $this->adressType $adressType;
  263.         return $this;
  264.     }
  265.     /**
  266.      * Get adressType
  267.      *
  268.      * @return string
  269.      */
  270.     public function getAdressType()
  271.     {
  272.         return $this->adressType;
  273.     }
  274.     /**
  275.      * Set email
  276.      *
  277.      * @param string $email
  278.      * @return ContactBook
  279.      */
  280.     public function setEmail($email)
  281.     {
  282.         $this->email $email;
  283.         return $this;
  284.     }
  285.     /**
  286.      * Get email
  287.      *
  288.      * @return string
  289.      */
  290.     public function getEmail()
  291.     {
  292.         return $this->email;
  293.     }
  294.     /**
  295.      * Set street1
  296.      *
  297.      * @param string $street1
  298.      * @return ContactBook
  299.      */
  300.     public function setStreet1($street1)
  301.     {
  302.         $this->street1 $street1;
  303.         return $this;
  304.     }
  305.     /**
  306.      * Get street1
  307.      *
  308.      * @return string
  309.      */
  310.     public function getStreet1()
  311.     {
  312.         return $this->street1;
  313.     }
  314.     /**
  315.      * Set street2
  316.      *
  317.      * @param string $street2
  318.      * @return ContactBook
  319.      */
  320.     public function setStreet2($street2)
  321.     {
  322.         $this->street2 $street2;
  323.         return $this;
  324.     }
  325.     /**
  326.      * Get street2
  327.      *
  328.      * @return string
  329.      */
  330.     public function getStreet2()
  331.     {
  332.         return $this->street2;
  333.     }
  334.     /**
  335.      * Set countryId
  336.      *
  337.      * @param integer $countryId
  338.      * @return ContactBook
  339.      */
  340.     public function setCountryId($countryId)
  341.     {
  342.         $this->countryId $countryId;
  343.         return $this;
  344.     }
  345.     /**
  346.      * Get countryId
  347.      *
  348.      * @return integer
  349.      */
  350.     public function getCountryId()
  351.     {
  352.         return $this->countryId;
  353.     }
  354.     /**
  355.      * Set stateId
  356.      *
  357.      * @param integer $stateId
  358.      * @return ContactBook
  359.      */
  360.     public function setStateId($stateId)
  361.     {
  362.         $this->stateId $stateId;
  363.         return $this;
  364.     }
  365.     /**
  366.      * Get stateId
  367.      *
  368.      * @return integer
  369.      */
  370.     public function getStateId()
  371.     {
  372.         return $this->stateId;
  373.     }
  374.     /**
  375.      * Set cityId
  376.      *
  377.      * @param integer $cityId
  378.      * @return ContactBook
  379.      */
  380.     public function setCityId($cityId)
  381.     {
  382.         $this->cityId $cityId;
  383.         return $this;
  384.     }
  385.     /**
  386.      * Get cityId
  387.      *
  388.      * @return integer
  389.      */
  390.     public function getCityId()
  391.     {
  392.         return $this->cityId;
  393.     }
  394.     /**
  395.      * Set zipcode
  396.      *
  397.      * @param string $zipcode
  398.      * @return ContactBook
  399.      */
  400.     public function setZipcode($zipcode)
  401.     {
  402.         $this->zipcode $zipcode;
  403.         return $this;
  404.     }
  405.     /**
  406.      * Get zipcode
  407.      *
  408.      * @return string
  409.      */
  410.     public function getZipcode()
  411.     {
  412.         return $this->zipcode;
  413.     }
  414.     /**
  415.      * Set extension
  416.      *
  417.      * @param string $extension
  418.      * @return ContactBook
  419.      */
  420.     public function setExtension($extension)
  421.     {
  422.         $this->extension $extension;
  423.         return $this;
  424.     }
  425.     /**
  426.      * Get extension
  427.      *
  428.      * @return string
  429.      */
  430.     public function getExtension()
  431.     {
  432.         return $this->extension;
  433.     }
  434.     /**
  435.      * Set phone
  436.      *
  437.      * @param string $phone
  438.      * @return ContactBook
  439.      */
  440.     public function setPhone($phone)
  441.     {
  442.         $this->phone $phone;
  443.         return $this;
  444.     }
  445.     /**
  446.      * Get phone
  447.      *
  448.      * @return string
  449.      */
  450.     public function getPhone()
  451.     {
  452.         return $this->phone;
  453.     }
  454.     /**
  455.      * Set mobile
  456.      *
  457.      * @param string $mobile
  458.      * @return ContactBook
  459.      */
  460.     public function setMobile($mobile)
  461.     {
  462.         $this->mobile $mobile;
  463.         return $this;
  464.     }
  465.     /**
  466.      * Get mobile
  467.      *
  468.      * @return string
  469.      */
  470.     public function getMobile()
  471.     {
  472.         return $this->mobile;
  473.     }
  474.     /**
  475.      * Set fax
  476.      *
  477.      * @param string $fax
  478.      * @return ContactBook
  479.      */
  480.     public function setFax($fax)
  481.     {
  482.         $this->fax $fax;
  483.         return $this;
  484.     }
  485.     /**
  486.      * Get fax
  487.      *
  488.      * @return string
  489.      */
  490.     public function getFax()
  491.     {
  492.         return $this->fax;
  493.     }
  494.     /**
  495.      * Set website
  496.      *
  497.      * @param string $website
  498.      * @return ContactBook
  499.      */
  500.     public function setWebsite($website)
  501.     {
  502.         $this->website $website;
  503.         return $this;
  504.     }
  505.     /**
  506.      * Get website
  507.      *
  508.      * @return string
  509.      */
  510.     public function getWebsite()
  511.     {
  512.         return $this->website;
  513.     }
  514.     /**
  515.      * Set erpId
  516.      *
  517.      * @param integer $erpId
  518.      * @return ContactBook
  519.      */
  520.     public function setErpId($erpId)
  521.     {
  522.         $this->erpId $erpId;
  523.         return $this;
  524.     }
  525.     /**
  526.      * Get erpId
  527.      *
  528.      * @return integer
  529.      */
  530.     public function getErpId()
  531.     {
  532.         return $this->erpId;
  533.     }
  534.     /**
  535.      * Set createdAt
  536.      *
  537.      * @param \DateTime $createdAt
  538.      * @return ContactBook
  539.      */
  540.     public function setCreatedAt($createdAt)
  541.     {
  542.         $this->createdAt $createdAt;
  543.         return $this;
  544.     }
  545.     /**
  546.      * Get createdAt
  547.      *
  548.      * @return \DateTime
  549.      */
  550.     public function getCreatedAt()
  551.     {
  552.         return $this->createdAt;
  553.     }
  554.     /**
  555.      * Set updatedAt
  556.      *
  557.      * @param \DateTime $updatedAt
  558.      * @return ContactBook
  559.      */
  560.     public function setUpdatedAt($updatedAt)
  561.     {
  562.         $this->updatedAt $updatedAt;
  563.         return $this;
  564.     }
  565.     /**
  566.      * Get updatedAt
  567.      *
  568.      * @return \DateTime
  569.      */
  570.     public function getUpdatedAt()
  571.     {
  572.         return $this->updatedAt;
  573.     }
  574.     /**
  575.      * Set deletedAt
  576.      *
  577.      * @param \DateTime $deletedAt
  578.      * @return ContactBook
  579.      */
  580.     public function setDeletedAt($deletedAt)
  581.     {
  582.         $this->deletedAt $deletedAt;
  583.         return $this;
  584.     }
  585.     /**
  586.      * Get deletedAt
  587.      *
  588.      * @return \DateTime
  589.      */
  590.     public function getDeletedAt()
  591.     {
  592.         return $this->deletedAt;
  593.     }
  594.     /**
  595.      * Set createdUid
  596.      *
  597.      * @param integer $createdUid
  598.      * @return ContactBook
  599.      */
  600.     public function setCreatedUid($createdUid)
  601.     {
  602.         $this->createdUid $createdUid;
  603.         return $this;
  604.     }
  605.     /**
  606.      * Get createdUid
  607.      *
  608.      * @return integer
  609.      */
  610.     public function getCreatedUid()
  611.     {
  612.         return $this->createdUid;
  613.     }
  614.     /**
  615.      * Set updatedUid
  616.      *
  617.      * @param integer $updatedUid
  618.      * @return ContactBook
  619.      */
  620.     public function setUpdatedUid($updatedUid)
  621.     {
  622.         $this->updatedUid $updatedUid;
  623.         return $this;
  624.     }
  625.     /**
  626.      * Get updatedUid
  627.      *
  628.      * @return integer
  629.      */
  630.     public function getUpdatedUid()
  631.     {
  632.         return $this->updatedUid;
  633.     }
  634.     /**
  635.      * Set deletedUid
  636.      *
  637.      * @param integer $deletedUid
  638.      * @return ContactBook
  639.      */
  640.     public function setDeletedUid($deletedUid)
  641.     {
  642.         $this->deletedUid $deletedUid;
  643.         return $this;
  644.     }
  645.     /**
  646.      * Get deletedUid
  647.      *
  648.      * @return integer
  649.      */
  650.     public function getDeletedUid()
  651.     {
  652.         return $this->deletedUid;
  653.     }
  654.     // @param \App\project\OfficeBrain\CustomBundle\UserBundle\Entity\User $contactBook
  655.     /**
  656.      * Set contactBook
  657.      *
  658.      * @param \App\OfficeBrain\Bundle\UserBundle\Entity\User $contactBook
  659.      * @return ContactBook
  660.      */
  661.     public function setContactBook(\App\OfficeBrain\Bundle\UserBundle\Entity\User $contactBook null)
  662.     {
  663.         $this->contactBook $contactBook;
  664.         return $this;
  665.     }
  666.     // @return \App\project\OfficeBrain\CustomBundle\UserBundle\Entity\User
  667.     /**
  668.      * Get contactBook
  669.      *
  670.      * @return \App\OfficeBrain\Bundle\UserBundle\Entity\User
  671.      */
  672.     public function getContactBook()
  673.     {
  674.         return $this->contactBook;
  675.     }
  676.     // @param \App\project\OfficeBrain\CustomBundle\UserBundle\Entity\User $user
  677.     /**
  678.      * Set user
  679.      *
  680.      * @param \App\OfficeBrain\Bundle\UserBundle\Entity\User $user
  681.      * @return ContactBook
  682.      */
  683.     public function setUser(\App\OfficeBrain\Bundle\UserBundle\Entity\User $user null)
  684.     {
  685.         $this->user $user;
  686.         return $this;
  687.     }
  688.     // @return \App\project\OfficeBrain\CustomBundle\UserBundle\Entity\User
  689.     /**
  690.      * Get user
  691.      *
  692.      * @return \App\OfficeBrain\Bundle\UserBundle\Entity\User
  693.      */
  694.     public function getUser()
  695.     {
  696.         return $this->user;
  697.     }
  698.     /**
  699.      * Set isAddress
  700.      *
  701.      * @param integer $isAddress
  702.      * @return ContactBook
  703.      */
  704.     public function setIsAddress($isAddress)
  705.     {
  706.         $this->isAddress $isAddress;
  707.         return $this;
  708.     }
  709.     /**
  710.      * Get isAddress
  711.      *
  712.      * @return integer
  713.      */
  714.     public function getIsAddress()
  715.     {
  716.         return $this->isAddress;
  717.     }
  718.     /**
  719.      * Set isDefault
  720.      *
  721.      * @param integer $isDefault
  722.      * @return ContactBook
  723.      */
  724.     public function setIsDefault($isDefault)
  725.     {
  726.         $this->isDefault $isDefault;
  727.         return $this;
  728.     }
  729.     /**
  730.      * Get isDefault
  731.      *
  732.      * @return integer
  733.      */
  734.     public function getIsDefault()
  735.     {
  736.         return $this->isDefault;
  737.     }
  738.     /**
  739.      * Set companyName
  740.      *
  741.      * @param string $companyName
  742.      * @return ContactBook
  743.      */
  744.     public function setCompanyName($companyName)
  745.     {
  746.         $this->companyName $companyName;
  747.         return $this;
  748.     }
  749.     /**
  750.      * Get companyName
  751.      *
  752.      * @return string
  753.      */
  754.     public function getCompanyName()
  755.     {
  756.         return $this->companyName;
  757.     }
  758.     /**
  759.      * Set companyNumber
  760.      *
  761.      * @param string $companyNumber
  762.      * @return ContactBook
  763.      */
  764.     public function setCompanyNumber($companyNumber)
  765.     {
  766.         $this->companyNumber $companyNumber;
  767.         return $this;
  768.     }
  769.     /**
  770.      * Get companyNumber
  771.      *
  772.      * @return string
  773.      */
  774.     public function getCompanyNumber()
  775.     {
  776.         return $this->companyNumber;
  777.     }
  778.     /**
  779.      * Set isOffice
  780.      *
  781.      * @param integer $isOffice
  782.      * @return ContactBook
  783.      */
  784.     public function setIsOffice($isOffice)
  785.     {
  786.         $this->isOffice $isOffice;
  787.         return $this;
  788.     }
  789.     /**
  790.      * Get isOffice
  791.      *
  792.      * @return integer 
  793.      */
  794.     public function getIsOffice()
  795.     {
  796.         return $this->isOffice;
  797.     }
  798.     /**
  799.      * Set otherCountry
  800.      *
  801.      * @param string $otherCountry
  802.      * @return string
  803.      */
  804.     public function setOtherCountry($otherCountry)
  805.     {
  806.         $this->otherCountry $otherCountry;
  807.     
  808.         return $this;
  809.     }
  810.     
  811.     /**
  812.      * Get otherCountry
  813.      *
  814.      * @return string
  815.      */
  816.     public function getOtherCountry()
  817.     {
  818.         return $this->otherCountry;
  819.     }
  820. }