src/Admin/Entity/StdWebUsersAddresses.php line 370

Open in your IDE?
  1. <?php
  2. namespace App\Admin\Entity;
  3. use JsonSerializable;
  4. use Doctrine\ORM\Mapping as ORM;
  5. /**
  6.  * StdWebUsersAddresses
  7.  */
  8. #[ORM\Table(name'std_web_users_addresses')]
  9. #[ORM\Index(name'FK__std_web_users'columns: ['webuser_id'])]
  10. #[ORM\Entity]
  11. #[ORM\HasLifecycleCallbacks]
  12. class StdWebUsersAddresses implements JsonSerializable
  13. {
  14.     /**
  15.      * @var int
  16.      */
  17.     #[ORM\Column(name'id'type'integer'nullablefalseoptions: ['unsigned' => true'comment' => 'Unique identifier'])]
  18.     #[ORM\Id]
  19.     #[ORM\GeneratedValue(strategy'IDENTITY')]
  20.     private $id;
  21.     /**
  22.      * @var string|null
  23.      */
  24.     #[ORM\Column(name'erp_code'type'string'length50nullabletrueoptions: ['comment' => "User's erp code"])]
  25.     private $erpCode;
  26.     /**
  27.      * @var string|null
  28.      */
  29.     #[ORM\Column(name'name'type'string'length250nullabletrueoptions: ['comment' => 'Address description'])]
  30.     private $name;
  31.     /**
  32.      * @var string|null
  33.      */
  34.     #[ORM\Column(name'address_line_1'type'string'length500nullabletrueoptions: ['comment' => 'Address first line'])]
  35.     private $addressLine1;
  36.     /**
  37.      * @var string|null
  38.      */
  39.     #[ORM\Column(name'address_line_2'type'string'length500nullabletrueoptions: ['comment' => 'Address second line'])]
  40.     private $addressLine2;
  41.     /**
  42.      * @var string|null
  43.      */
  44.     #[ORM\Column(name'zipcode_1'type'string'length50nullabletrueoptions: ['comment' => 'Zipcode first part'])]
  45.     private $zipcode1;
  46.     /**
  47.      * @var string|null
  48.      */
  49.     #[ORM\Column(name'zipcode_2'type'string'length50nullabletrueoptions: ['comment' => 'Zipcode second part'])]
  50.     private $zipcode2;
  51.     /**
  52.      * @var string|null
  53.      */
  54.     #[ORM\Column(name'city'type'string'length50nullabletrueoptions: ['comment' => 'Address city'])]
  55.     private $city;
  56.     /**
  57.      * @var string|null
  58.      */
  59.     #[ORM\Column(name'state'type'string'length50nullabletrueoptions: ['comment' => 'Address state'])]
  60.     private $state;
  61.     /**
  62.      * @var string|null
  63.      */
  64.     #[ORM\Column(name'country'type'string'length100nullabletrueoptions: ['comment' => 'Address country'])]
  65.     private $country;
  66.     /**
  67.      * @var json|null
  68.      */
  69.     #[ORM\Column(name'custom_fields'type'json'nullabletrueoptions: ['comment' => 'Json structure with custom fields'])]
  70.     private $customFields;
  71.     /**
  72.      * @var bool|null
  73.      */
  74.     #[ORM\Column(name'is_billing'type'boolean'nullabletrueoptions: ['comment' => "Flag that indicates this is the user's billing address"])]
  75.     private $isBilling;
  76.     /**
  77.      * @var bool|null
  78.      */
  79.     #[ORM\Column(name'is_default'type'boolean'nullabletrueoptions: ['comment' => "Flag that indicates this is the user's default billing or shipping address depending on the is_billing column"])]
  80.     private $isDefault;
  81.     /**
  82.      * @var bool
  83.      */
  84.     #[ORM\Column(name'is_active'type'boolean'nullablefalseoptions: ['default' => 1'comment' => 'Flag that indicates if the record is active'])]
  85.     private $isActive '1';
  86.     /**
  87.      * @var string|null
  88.      */
  89.     #[ORM\Column(name'phone'type'string'length50nullabletrue)]
  90.     private $phone;
  91.     /**
  92.      * @var string|null
  93.      */
  94.     #[ORM\Column(name'mobile'type'string'length50nullabletrue)]
  95.     private $mobile;
  96.     /**
  97.      * @var \DateTime
  98.      */
  99.     #[ORM\Column(name'created_date'type'datetime'nullablefalseoptions: ['comment' => 'Date and time of the record creation'])]
  100.     private $createdDate;
  101.     /**
  102.      * @var \DateTime
  103.      */
  104.     #[ORM\Column(name'updated_date'type'datetime'nullablefalseoptions: ['comment' => 'Date and time the record was last updated'])]
  105.     private $updatedDate;
  106.     /**
  107.      * @var \StdWebUsers
  108.      */
  109.     #[ORM\ManyToOne(targetEntity'\App\Admin\Entity\StdWebUsers'inversedBy'addresses'cascade: ['persist'])]
  110.     #[ORM\JoinColumn(nullablefalse)]
  111.     private $webuser;
  112.     public function getId(): ?int
  113.     {
  114.         return $this->id;
  115.     }
  116.     public function setId(?int $id): self
  117.     {
  118.         $this->id=$id;
  119.         return $this;
  120.     }
  121.     public function getErpCode(): ?string
  122.     {
  123.         return $this->erpCode;
  124.     }
  125.     public function setErpCode(?string $erpcode): self
  126.     {
  127.         $this->erpCode $erpcode;
  128.         return $this;
  129.     }
  130.     public function getName(): ?string
  131.     {
  132.         return $this->name;
  133.     }
  134.     public function setName(?string $name): self
  135.     {
  136.         $this->name $name;
  137.         return $this;
  138.     }
  139.     public function getAddressLine1(): ?string
  140.     {
  141.         return $this->addressLine1;
  142.     }
  143.     public function setAddressLine1(?string $addressLine1): self
  144.     {
  145.         $this->addressLine1 $addressLine1;
  146.         return $this;
  147.     }
  148.     public function getAddressLine2(): ?string
  149.     {
  150.         return $this->addressLine2;
  151.     }
  152.     public function setAddressLine2(?string $addressLine2): self
  153.     {
  154.         $this->addressLine2 $addressLine2;
  155.         return $this;
  156.     }
  157.     public function getZipcode1(): ?string
  158.     {
  159.         return $this->zipcode1;
  160.     }
  161.     public function setZipcode1(?string $zipcode1): self
  162.     {
  163.         $this->zipcode1 $zipcode1;
  164.         return $this;
  165.     }
  166.     public function getZipcode2(): ?string
  167.     {
  168.         return $this->zipcode2;
  169.     }
  170.     public function setZipcode2(?string $zipcode2): self
  171.     {
  172.         $this->zipcode2 $zipcode2;
  173.         return $this;
  174.     }
  175.     public function getCity(): ?string
  176.     {
  177.         return $this->city;
  178.     }
  179.     public function setCity(?string $city): self
  180.     {
  181.         $this->city $city;
  182.         return $this;
  183.     }
  184.     public function getState(): ?string
  185.     {
  186.         return $this->state;
  187.     }
  188.     public function setState(?string $state): self
  189.     {
  190.         $this->state $state;
  191.         return $this;
  192.     }
  193.     public function getCountry(): ?string
  194.     {
  195.         return $this->country;
  196.     }
  197.     public function setCountry(?string $country): self
  198.     {
  199.         $this->country $country;
  200.         return $this;
  201.     }
  202.     public function getCustomFields(): ?array
  203.     {
  204.         return $this->customFields;
  205.     }
  206.     public function setCustomFields(?array $customFields): self
  207.     {
  208.         $this->customFields $customFields;
  209.         return $this;
  210.     }
  211.     public function getIsBilling(): ?bool
  212.     {
  213.         return $this->isBilling;
  214.     }
  215.     public function setIsBilling(?bool $isBilling): self
  216.     {
  217.         $this->isBilling $isBilling;
  218.         return $this;
  219.     }
  220.     public function getIsDefault(): ?bool
  221.     {
  222.         return $this->isDefault;
  223.     }
  224.     public function setIsDefault(?bool $isDefault): self
  225.     {
  226.         $this->isDefault $isDefault;
  227.         return $this;
  228.     }
  229.     public function getIsActive(): ?bool
  230.     {
  231.         return $this->isActive;
  232.     }
  233.     public function setIsActive(bool $isActive): self
  234.     {
  235.         $this->isActive $isActive;
  236.         return $this;
  237.     }
  238.     public function getPhone(): ?string
  239.     {
  240.         return $this->phone;
  241.     }
  242.     public function setPhone(?string $phone): self
  243.     {
  244.         $this->phone $phone;
  245.         return $this;
  246.     }
  247.     public function getMobile(): ?string
  248.     {
  249.         return $this->mobile;
  250.     }
  251.     public function setMobile(?string $mobile): self
  252.     {
  253.         $this->mobile $mobile;
  254.         return $this;
  255.     }
  256.     public function getCreatedDate(): ?\DateTimeInterface
  257.     {
  258.         return $this->createdDate;
  259.     }
  260.     public function setCreatedDate(\DateTimeInterface $createdDate): self
  261.     {
  262.         $this->createdDate $createdDate;
  263.         return $this;
  264.     }
  265.     public function getUpdatedDate(): ?\DateTimeInterface
  266.     {
  267.         return $this->updatedDate;
  268.     }
  269.     public function setUpdatedDate(\DateTimeInterface $updatedDate): self
  270.     {
  271.         $this->updatedDate $updatedDate;
  272.         return $this;
  273.     }
  274.     public function getWebuser(): ?StdWebUsers
  275.     {
  276.         return $this->webuser;
  277.     }
  278.     public function setWebuser(?StdWebUsers $webuser): self
  279.     {
  280.         $this->webuser $webuser;
  281.         return $this;
  282.     }
  283.      #[ORM\PreUpdate]
  284.     public function setUpdated()
  285.     {
  286.         $this->setUpdatedDate(new \DateTime());
  287.     }
  288.     
  289.     #[ORM\PrePersist]
  290.     public function setCreated()
  291.     {
  292.         $this->setUpdatedDate(new \DateTime());
  293.         $this->setCreatedDate(new \DateTime());
  294.     }
  295.     public function jsonSerialize()
  296.     {
  297.         $result get_object_vars($this);
  298.         unset($result['webuser']);
  299.         return $result;
  300.     }
  301. }