src/OfficeBrain/Bundle/UserBundle/Entity/ContactBook.php line 26

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