<?php
namespace App\Admin\Entity;
use JsonSerializable;
use Doctrine\ORM\Mapping as ORM;
/**
* StdWebUsersAddresses
*/
#[ORM\Table(name: 'std_web_users_addresses')]
#[ORM\Index(name: 'FK__std_web_users', columns: ['webuser_id'])]
#[ORM\Entity]
#[ORM\HasLifecycleCallbacks]
class StdWebUsersAddresses implements JsonSerializable
{
/**
* @var int
*/
#[ORM\Column(name: 'id', type: 'integer', nullable: false, options: ['unsigned' => true, 'comment' => 'Unique identifier'])]
#[ORM\Id]
#[ORM\GeneratedValue(strategy: 'IDENTITY')]
private $id;
/**
* @var string|null
*/
#[ORM\Column(name: 'erp_code', type: 'string', length: 50, nullable: true, options: ['comment' => "User's erp code"])]
private $erpCode;
/**
* @var string|null
*/
#[ORM\Column(name: 'name', type: 'string', length: 250, nullable: true, options: ['comment' => 'Address description'])]
private $name;
/**
* @var string|null
*/
#[ORM\Column(name: 'address_line_1', type: 'string', length: 500, nullable: true, options: ['comment' => 'Address first line'])]
private $addressLine1;
/**
* @var string|null
*/
#[ORM\Column(name: 'address_line_2', type: 'string', length: 500, nullable: true, options: ['comment' => 'Address second line'])]
private $addressLine2;
/**
* @var string|null
*/
#[ORM\Column(name: 'zipcode_1', type: 'string', length: 50, nullable: true, options: ['comment' => 'Zipcode first part'])]
private $zipcode1;
/**
* @var string|null
*/
#[ORM\Column(name: 'zipcode_2', type: 'string', length: 50, nullable: true, options: ['comment' => 'Zipcode second part'])]
private $zipcode2;
/**
* @var string|null
*/
#[ORM\Column(name: 'city', type: 'string', length: 50, nullable: true, options: ['comment' => 'Address city'])]
private $city;
/**
* @var string|null
*/
#[ORM\Column(name: 'state', type: 'string', length: 50, nullable: true, options: ['comment' => 'Address state'])]
private $state;
/**
* @var string|null
*/
#[ORM\Column(name: 'country', type: 'string', length: 100, nullable: true, options: ['comment' => 'Address country'])]
private $country;
/**
* @var json|null
*/
#[ORM\Column(name: 'custom_fields', type: 'json', nullable: true, options: ['comment' => 'Json structure with custom fields'])]
private $customFields;
/**
* @var bool|null
*/
#[ORM\Column(name: 'is_billing', type: 'boolean', nullable: true, options: ['comment' => "Flag that indicates this is the user's billing address"])]
private $isBilling;
/**
* @var bool|null
*/
#[ORM\Column(name: 'is_default', type: 'boolean', nullable: true, options: ['comment' => "Flag that indicates this is the user's default billing or shipping address depending on the is_billing column"])]
private $isDefault;
/**
* @var bool
*/
#[ORM\Column(name: 'is_active', type: 'boolean', nullable: false, options: ['default' => 1, 'comment' => 'Flag that indicates if the record is active'])]
private $isActive = '1';
/**
* @var string|null
*/
#[ORM\Column(name: 'phone', type: 'string', length: 50, nullable: true)]
private $phone;
/**
* @var string|null
*/
#[ORM\Column(name: 'mobile', type: 'string', length: 50, nullable: true)]
private $mobile;
/**
* @var \DateTime
*/
#[ORM\Column(name: 'created_date', type: 'datetime', nullable: false, options: ['comment' => 'Date and time of the record creation'])]
private $createdDate;
/**
* @var \DateTime
*/
#[ORM\Column(name: 'updated_date', type: 'datetime', nullable: false, options: ['comment' => 'Date and time the record was last updated'])]
private $updatedDate;
/**
* @var \StdWebUsers
*/
#[ORM\ManyToOne(targetEntity: '\App\Admin\Entity\StdWebUsers', inversedBy: 'addresses', cascade: ['persist'])]
#[ORM\JoinColumn(nullable: false)]
private $webuser;
public function getId(): ?int
{
return $this->id;
}
public function setId(?int $id): self
{
$this->id=$id;
return $this;
}
public function getErpCode(): ?string
{
return $this->erpCode;
}
public function setErpCode(?string $erpcode): self
{
$this->erpCode = $erpcode;
return $this;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(?string $name): self
{
$this->name = $name;
return $this;
}
public function getAddressLine1(): ?string
{
return $this->addressLine1;
}
public function setAddressLine1(?string $addressLine1): self
{
$this->addressLine1 = $addressLine1;
return $this;
}
public function getAddressLine2(): ?string
{
return $this->addressLine2;
}
public function setAddressLine2(?string $addressLine2): self
{
$this->addressLine2 = $addressLine2;
return $this;
}
public function getZipcode1(): ?string
{
return $this->zipcode1;
}
public function setZipcode1(?string $zipcode1): self
{
$this->zipcode1 = $zipcode1;
return $this;
}
public function getZipcode2(): ?string
{
return $this->zipcode2;
}
public function setZipcode2(?string $zipcode2): self
{
$this->zipcode2 = $zipcode2;
return $this;
}
public function getCity(): ?string
{
return $this->city;
}
public function setCity(?string $city): self
{
$this->city = $city;
return $this;
}
public function getState(): ?string
{
return $this->state;
}
public function setState(?string $state): self
{
$this->state = $state;
return $this;
}
public function getCountry(): ?string
{
return $this->country;
}
public function setCountry(?string $country): self
{
$this->country = $country;
return $this;
}
public function getCustomFields(): ?array
{
return $this->customFields;
}
public function setCustomFields(?array $customFields): self
{
$this->customFields = $customFields;
return $this;
}
public function getIsBilling(): ?bool
{
return $this->isBilling;
}
public function setIsBilling(?bool $isBilling): self
{
$this->isBilling = $isBilling;
return $this;
}
public function getIsDefault(): ?bool
{
return $this->isDefault;
}
public function setIsDefault(?bool $isDefault): self
{
$this->isDefault = $isDefault;
return $this;
}
public function getIsActive(): ?bool
{
return $this->isActive;
}
public function setIsActive(bool $isActive): self
{
$this->isActive = $isActive;
return $this;
}
public function getPhone(): ?string
{
return $this->phone;
}
public function setPhone(?string $phone): self
{
$this->phone = $phone;
return $this;
}
public function getMobile(): ?string
{
return $this->mobile;
}
public function setMobile(?string $mobile): self
{
$this->mobile = $mobile;
return $this;
}
public function getCreatedDate(): ?\DateTimeInterface
{
return $this->createdDate;
}
public function setCreatedDate(\DateTimeInterface $createdDate): self
{
$this->createdDate = $createdDate;
return $this;
}
public function getUpdatedDate(): ?\DateTimeInterface
{
return $this->updatedDate;
}
public function setUpdatedDate(\DateTimeInterface $updatedDate): self
{
$this->updatedDate = $updatedDate;
return $this;
}
public function getWebuser(): ?StdWebUsers
{
return $this->webuser;
}
public function setWebuser(?StdWebUsers $webuser): self
{
$this->webuser = $webuser;
return $this;
}
#[ORM\PreUpdate]
public function setUpdated()
{
$this->setUpdatedDate(new \DateTime());
}
#[ORM\PrePersist]
public function setCreated()
{
$this->setUpdatedDate(new \DateTime());
$this->setCreatedDate(new \DateTime());
}
public function jsonSerialize()
{
$result = get_object_vars($this);
unset($result['webuser']);
return $result;
}
}