<?php
namespace App\OfficeBrain\Bundle\UserBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as GEDMO;
use Symfony\Component\Validator\Constraints as Assert;
use JMS\Serializer\Annotation\ExclusionPolicy;
use JMS\Serializer\Annotation\Exclude;
/**
* Entity For Contact Book
* @author OfficeBrain 4493
*/
/**
* ContactBook
*
* @ORM\Table(name="tbl_user_contact_book")
* @ORM\Entity(repositoryClass="App\OfficeBrain\Bundle\UserBundle\Entity\ContactBookRepository")
* @Gedmo\SoftDeleteable(fieldName="deletedAt", timeAware=false)
* @ExclusionPolicy("none")
*/
class ContactBook
{
/**
* @var integer
*
* @ORM\Column(name="id", type="bigint", length=20, options={"unsigned"=true})
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @var integer
* @ORM\ManyToOne(targetEntity="User", inversedBy="contactBook")
* @ORM\JoinColumn(name="user_id",referencedColumnName="id")
*/
private $user;
/**
* @var string
* @ORM\Column(name="name", type="string", length=100, options={"collate"="utf8_unicode_ci"},nullable=true)
* @Assert\NotBlank(message = "user.contact_book.name.not_blank")
* @Assert\Regex(pattern="/^[A-Za-z_\-'\s]+$/", match=true, message="user.contact_book.name.not_valid" )
*/
private $name;
/**
* @var integer
* @ORM\ManyToOne(targetEntity="\App\OfficeBrain\Bundle\CoreBundle\Entity\AddressType", inversedBy="contactBook")
* @ORM\JoinColumn(name="adress_type",referencedColumnName="id")
* @Assert\NotBlank(message = "user.contact_book.addressType.not_blank")
*/
private $adressType;
/**
* @var string
*
* @ORM\Column(name="email", type="string", length=100, options={"collate"="utf8_unicode_ci"},nullable=true)
* @Assert\NotBlank(message = "user.contact_book.email.not_blank")
* @Assert\Regex(
* pattern="/^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$/",
* match=true,
* message="user.contact_book.email.not_valid"
* )
*/
private $email;
/**
* @var string
*
* @ORM\Column(name="company_name", type="string", length=255, options={"collate"="utf8_unicode_ci"} ,nullable=true)
*/
private $companyName;
/**
* @var string
*
* @ORM\Column(name="company_number", type="string", length=255, options={"collate"="utf8_unicode_ci"} ,nullable=true)
*/
private $companyNumber;
/**
* @var string
*
* @ORM\Column(name="street1", type="text", options={"collate"="utf8_unicode_ci"}, nullable=true)
* @Assert\NotBlank(message = "user.contact_book.street1.not_blank")
*/
private $street1;
/**
* @var string
* @ORM\Column(name="street2", type="text", options={"collate"="utf8_unicode_ci"}, nullable=true)
*/
private $street2;
/**
* @var integer
*
* @ORM\Column(name="country_id", type="bigint", length=20,options={"unsigned"=true},nullable=true)
* @Assert\NotBlank(message = "user.contact_book.countryId.not_blank")
*/
private $countryId;
/**
* @var integer
*
* @ORM\Column(name="state_id", type="bigint", length=20,options={"unsigned"=true},nullable=true)
* @Assert\NotBlank(message = "user.contact_book.stateId.not_blank")
*/
private $stateId;
/**
* @var integer
*
* @ORM\Column(name="city_id", type="bigint", length=20,options={"unsigned"=true},nullable=true)
* @Assert\NotBlank(message = "user.contact_book.cityId.not_blank")
*/
private $cityId;
/**
* @var string
*
* @ORM\Column(name="zipcode", type="string", length=50, options={"collate"="utf8_unicode_ci"},nullable=true)
* @Assert\NotBlank(message = "user.contact_book.zipcode.not_blank")
* @Assert\Length(max = 8, maxMessage = "user.contact_book.zipcode.max_length" )
* @Assert\Regex(pattern="/^[A-Za-z0-9\s]+$/", match=true, message="user.contact_book.zipcode.not_valid" )
*/
private $zipcode;
/**
* @var string
*
* @ORM\Column(name="extension", type="string", length=50, options={"collate"="utf8_nicode_ci"},nullable=true)
* @Assert\Length(max = 8, maxMessage = "user.contact_book.extension.max_length" )
* @Assert\Regex(pattern="/^[0-9]+$/", match=true, message="user.contact_book.extension.not_valid" )
*/
private $extension;
/**
* @var string
*
* @ORM\Column(name="phone", type="string", length=50, options={"collate"="utf8_unicode_ci"},nullable=true)
* @Assert\Length(min=12, minMessage="user.contact_book.phone.invalid")
* @Assert\Regex(pattern="/^[0-9-\+]+$/", match=true, message="user.contact_book.phone.not_valid" )
*/
private $phone;
/**
* @var string
*
* @ORM\Column(name="mobile", type="string", length=50, options={"collate"="utf8_unicode_ci"},nullable=true)
* @Assert\Length(min=12, minMessage="user.contact_book.mobile.invalid")
* @Assert\Regex(pattern="/^[0-9-\+]+$/", match=true, message="user.contact_book.mobile.not_valid" )
*/
private $mobile;
/**
* @var string
*
* @ORM\Column(name="fax", type="string", length=100, options={"collate"="utf8_unicode_ci"},nullable=true)
* @Assert\Length(min=12, minMessage="user.contact_book.fax.invalid")
* @Assert\Regex(pattern="/^[0-9\-]+$/", match=true, message="user.contact_book.fax.not_valid" )
*/
private $fax;
/**
* @var string
*
* @ORM\Column(name="website", type="string", length=100, options={"collate"="utf8_unicode_ci"},nullable=true)
* @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" )
*/
private $website;
/**
* @var integer
*
* @ORM\Column(name="erp_id", type="bigint" ,length=20 ,options={"unsigned"=true},nullable=true)
*/
private $erpId;
/**
* @var integer
*
* @ORM\Column(name="is_address", type="bigint" ,length=20 ,options={"unsigned"=true},nullable=true)
*/
private $isAddress;
/**
* @var integer
*
* @ORM\Column(name="is_office", type="bigint", length=20 ,options={"unsigned"=true},nullable=true)
*/
private $isOffice;
/**
* @var integer
*
* @ORM\Column(name="is_default", type="bigint" ,length=20 ,options={"unsigned"=true},nullable=true)
*/
private $isDefault;
/**
* @var datetime
*
* @Gedmo\Timestampable(on="create")
* @ORM\Column(name="created_at",type="datetime",nullable=true)
*/
protected $createdAt;
/**
* @var datetime
*
* @Gedmo\Timestampable(on="update")
* @ORM\Column( name="updated_at", type="datetime",nullable=true)
*/
protected $updatedAt;
/**
* @var datetime
*
* @ORM\Column(name="deleted_at",type="datetime", nullable=true)
*/
protected $deletedAt;
/**
* @var integer
* @ORM\Column(name="created_uid", type="bigint" ,length=20 ,options={"unsigned"=true},nullable=true)
*/
private $createdUid;
/**
* @var integer
* @ORM\Column(name="updated_uid", type="bigint" ,length=20 ,options={"unsigned"=true},nullable=true)
*/
private $updatedUid;
/**
* @var integer
* @ORM\Column(name="deleted_uid", type="bigint" ,length=20 ,options={"unsigned"=true},nullable=true)
*/
private $deletedUid;
/**
* Get id
*
* @return integer
*/
public function getId()
{
return $this->id;
}
/**
* Set name
*
* @param string $name
* @return ContactBook
*/
public function setName($name)
{
$this->name = $name;
return $this;
}
/**
* Get name
*
* @return string
*/
public function getName()
{
return $this->name;
}
/**
* Set adressType
*
* @param string $adressType
* @return ContactBook
*/
public function setAdressType($adressType)
{
$this->adressType = $adressType;
return $this;
}
/**
* Get adressType
*
* @return string
*/
public function getAdressType()
{
return $this->adressType;
}
/**
* Set email
*
* @param string $email
* @return ContactBook
*/
public function setEmail($email)
{
$this->email = $email;
return $this;
}
/**
* Get email
*
* @return string
*/
public function getEmail()
{
return $this->email;
}
/**
* Set street1
*
* @param string $street1
* @return ContactBook
*/
public function setStreet1($street1)
{
$this->street1 = $street1;
return $this;
}
/**
* Get street1
*
* @return string
*/
public function getStreet1()
{
return $this->street1;
}
/**
* Set street2
*
* @param string $street2
* @return ContactBook
*/
public function setStreet2($street2)
{
$this->street2 = $street2;
return $this;
}
/**
* Get street2
*
* @return string
*/
public function getStreet2()
{
return $this->street2;
}
/**
* Set countryId
*
* @param integer $countryId
* @return ContactBook
*/
public function setCountryId($countryId)
{
$this->countryId = $countryId;
return $this;
}
/**
* Get countryId
*
* @return integer
*/
public function getCountryId()
{
return $this->countryId;
}
/**
* Set stateId
*
* @param integer $stateId
* @return ContactBook
*/
public function setStateId($stateId)
{
$this->stateId = $stateId;
return $this;
}
/**
* Get stateId
*
* @return integer
*/
public function getStateId()
{
return $this->stateId;
}
/**
* Set cityId
*
* @param integer $cityId
* @return ContactBook
*/
public function setCityId($cityId)
{
$this->cityId = $cityId;
return $this;
}
/**
* Get cityId
*
* @return integer
*/
public function getCityId()
{
return $this->cityId;
}
/**
* Set zipcode
*
* @param string $zipcode
* @return ContactBook
*/
public function setZipcode($zipcode)
{
$this->zipcode = $zipcode;
return $this;
}
/**
* Get zipcode
*
* @return string
*/
public function getZipcode()
{
return $this->zipcode;
}
/**
* Set extension
*
* @param string $extension
* @return ContactBook
*/
public function setExtension($extension)
{
$this->extension = $extension;
return $this;
}
/**
* Get extension
*
* @return string
*/
public function getExtension()
{
return $this->extension;
}
/**
* Set phone
*
* @param string $phone
* @return ContactBook
*/
public function setPhone($phone)
{
$this->phone = $phone;
return $this;
}
/**
* Get phone
*
* @return string
*/
public function getPhone()
{
return $this->phone;
}
/**
* Set mobile
*
* @param string $mobile
* @return ContactBook
*/
public function setMobile($mobile)
{
$this->mobile = $mobile;
return $this;
}
/**
* Get mobile
*
* @return string
*/
public function getMobile()
{
return $this->mobile;
}
/**
* Set fax
*
* @param string $fax
* @return ContactBook
*/
public function setFax($fax)
{
$this->fax = $fax;
return $this;
}
/**
* Get fax
*
* @return string
*/
public function getFax()
{
return $this->fax;
}
/**
* Set website
*
* @param string $website
* @return ContactBook
*/
public function setWebsite($website)
{
$this->website = $website;
return $this;
}
/**
* Get website
*
* @return string
*/
public function getWebsite()
{
return $this->website;
}
/**
* Set erpId
*
* @param integer $erpId
* @return ContactBook
*/
public function setErpId($erpId)
{
$this->erpId = $erpId;
return $this;
}
/**
* Get erpId
*
* @return integer
*/
public function getErpId()
{
return $this->erpId;
}
/**
* Set createdAt
*
* @param \DateTime $createdAt
* @return ContactBook
*/
public function setCreatedAt($createdAt)
{
$this->createdAt = $createdAt;
return $this;
}
/**
* Get createdAt
*
* @return \DateTime
*/
public function getCreatedAt()
{
return $this->createdAt;
}
/**
* Set updatedAt
*
* @param \DateTime $updatedAt
* @return ContactBook
*/
public function setUpdatedAt($updatedAt)
{
$this->updatedAt = $updatedAt;
return $this;
}
/**
* Get updatedAt
*
* @return \DateTime
*/
public function getUpdatedAt()
{
return $this->updatedAt;
}
/**
* Set deletedAt
*
* @param \DateTime $deletedAt
* @return ContactBook
*/
public function setDeletedAt($deletedAt)
{
$this->deletedAt = $deletedAt;
return $this;
}
/**
* Get deletedAt
*
* @return \DateTime
*/
public function getDeletedAt()
{
return $this->deletedAt;
}
/**
* Set createdUid
*
* @param integer $createdUid
* @return ContactBook
*/
public function setCreatedUid($createdUid)
{
$this->createdUid = $createdUid;
return $this;
}
/**
* Get createdUid
*
* @return integer
*/
public function getCreatedUid()
{
return $this->createdUid;
}
/**
* Set updatedUid
*
* @param integer $updatedUid
* @return ContactBook
*/
public function setUpdatedUid($updatedUid)
{
$this->updatedUid = $updatedUid;
return $this;
}
/**
* Get updatedUid
*
* @return integer
*/
public function getUpdatedUid()
{
return $this->updatedUid;
}
/**
* Set deletedUid
*
* @param integer $deletedUid
* @return ContactBook
*/
public function setDeletedUid($deletedUid)
{
$this->deletedUid = $deletedUid;
return $this;
}
/**
* Get deletedUid
*
* @return integer
*/
public function getDeletedUid()
{
return $this->deletedUid;
}
/**
* Set contactBook
*
* @param \App\OfficeBrain\Bundle\UserBundle\Entity\User $contactBook
* @return ContactBook
*/
public function setContactBook(\App\OfficeBrain\Bundle\UserBundle\Entity\User $contactBook = null)
{
$this->contactBook = $contactBook;
return $this;
}
/**
* Get contactBook
*
* @return \App\OfficeBrain\Bundle\UserBundle\Entity\User
*/
public function getContactBook()
{
return $this->contactBook;
}
/**
* Set user
*
* @param \App\OfficeBrain\Bundle\UserBundle\Entity\User $user
* @return ContactBook
*/
public function setUser(\App\OfficeBrain\Bundle\UserBundle\Entity\User $user = null)
{
$this->user = $user;
return $this;
}
/**
* Get user
*
* @return \App\OfficeBrain\Bundle\UserBundle\Entity\User
*/
public function getUser()
{
return $this->user;
}
/**
* Set isAddress
*
* @param integer $isAddress
* @return ContactBook
*/
public function setIsAddress($isAddress)
{
$this->isAddress = $isAddress;
return $this;
}
/**
* Get isAddress
*
* @return integer
*/
public function getIsAddress()
{
return $this->isAddress;
}
/**
* Set isDefault
*
* @param integer $isDefault
* @return ContactBook
*/
public function setIsDefault($isDefault)
{
$this->isDefault = $isDefault;
return $this;
}
/**
* Get isDefault
*
* @return integer
*/
public function getIsDefault()
{
return $this->isDefault;
}
/**
* Set companyName
*
* @param string $companyName
* @return ContactBook
*/
public function setCompanyName($companyName)
{
$this->companyName = $companyName;
return $this;
}
/**
* Get companyName
*
* @return string
*/
public function getCompanyName()
{
return $this->companyName;
}
/**
* Set companyNumber
*
* @param string $companyNumber
* @return ContactBook
*/
public function setCompanyNumber($companyNumber)
{
$this->companyNumber = $companyNumber;
return $this;
}
/**
* Get companyNumber
*
* @return string
*/
public function getCompanyNumber()
{
return $this->companyNumber;
}
/**
* Set isOffice
*
* @param integer $isOffice
* @return ContactBook
*/
public function setIsOffice($isOffice)
{
$this->isOffice = $isOffice;
return $this;
}
/**
* Get isOffice
*
* @return integer
*/
public function getIsOffice()
{
return $this->isOffice;
}
}