<?php
namespace App\Entity;
use ApiPlatform\Core\Annotation\ApiResource;
use ApiPlatform\Core\Annotation\ApiFilter;
use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\SearchFilter;
use App\Repository\MemberRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Event\PreUpdateEventArgs;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Annotation\Groups;
/**
* @ORM\Entity(repositoryClass=MemberRepository::class)
* @ORM\HasLifecycleCallbacks()
* @ORM\EntityListeners({"App\EventListener\MemberListener"})
* @ApiResource(
* normalizationContext={"groups"={"member:read", "base:read", "assign:read"}},
* denormalizationContext={"groups"={"member:write", "base:write", "assign:write"}},
* )
* @ApiFilter(
* SearchFilter::class,
* properties={
* "externalId": "exact",
* "createdAt": "partial",
* "modifiedAt": "partial",
* }
* )
*/
class Member
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
* @Groups({"member:read", "base:read"})
*/
private $id;
/**
* @ORM\Column(type="string", length=255)
* @Groups({"member:read", "member:write", "base:read"})
*/
private $name;
/**
* @ORM\Column(type="string", length=255, nullable=true)
* @Groups({"member:read", "member:write", "base:read"})
*/
private $firstName;
/**
* @ORM\Column(type="string", length=255, nullable=true)
* @Groups({"member:read", "member:write", "base:read"})
*/
private $lastName;
/**
* @ORM\Column(type="string", length=255, nullable=true)
* @Groups({"member:read", "member:write", "base:read"})
*/
private $email;
/**
* @ORM\Column(type="string", length=255, nullable=true)
* @Groups({"member:read", "member:write", "base:read"})
*/
private $phone;
/**
* @ORM\Column(type="string", length=255, nullable=true)
* @Groups({"member:read", "member:write", "base:read"})
*/
private $fei;
/**
* @ORM\Column(type="string", length=255, nullable=true)
* @Groups({"member:read", "member:write", "base:read"})
*/
private $street;
/**
* @ORM\Column(type="string", length=255, nullable=true)
* @Groups({"member:read", "member:write", "base:read"})
*/
private $city;
/**
* @ORM\Column(type="string", length=255, nullable=true)
* @Groups({"member:read", "member:write", "base:read"})
*/
private $state;
/**
* @ORM\Column(type="string", length=255, nullable=true)
* @Groups({"member:read", "member:write", "base:read"})
*/
private $zip;
/**
* @ORM\Column(type="string", length=255, nullable=true)
* @Groups({"member:read", "member:write", "base:read"})
*/
private $industry;
/**
* @ORM\Column(type="string", length=100, nullable=true)
* @Groups({"member:read", "member:write", "base:read"})
*/
private $ethnicity;
/**
* @ORM\Column(type="string", length=36, nullable=true)
* @Groups({"member:read", "member:write", "base:read"})
*/
private $externalId;
/**
* @ORM\Column(type="decimal", precision=20, scale=2, nullable=true)
* @Groups({"member:read", "member:write", "base:read"})
*/
private $revenue;
/**
* @ORM\Column(type="string", length=100, nullable=true)
* @Groups({"member:read", "member:write", "base:read"})
*/
private $type;
/**
* @ORM\Column(type="string", length=50, nullable=true)
* @Groups({"member:read", "member:write", "base:read"})
*/
private $gender;
/**
* @ORM\Column(type="string", length=255, nullable=true)
* @Groups({"member:read", "member:write", "base:read"})
*/
private $businessType;
/**
* @ORM\Column(type="string", length=255, nullable=true)
* @Groups({"member:read", "member:write", "base:read"})
*/
private $businessStructure;
/**
* @ORM\Column(type="string", length=100, nullable=true)
* @Groups({"member:read", "member:write", "base:read"})
*/
private $geographicMarket;
/**
* @ORM\OneToMany(targetEntity=User::class, mappedBy="member")
*/
private $users;
/**
* @ORM\Column(type="text", nullable=true)
* @Groups({"member:read", "member:write", "base:read"})
*/
private $description;
/**
* @ORM\Column(type="string", length=255, nullable=true)
* @Groups({"member:read", "member:write", "base:read"})
*/
private $naics;
/**
* @ORM\Column(type="string", length=255, nullable=true)
* @Groups({"member:read", "member:write", "base:read"})
*/
private $nigp;
/**
* @ORM\Column(type="text", nullable=true)
* @Groups({"member:read", "member:write", "base:read"})
*/
private $keywords;
/**
* @ORM\Column(type="string", length=255, nullable=true)
* @Groups({"member:read", "member:write", "base:read"})
*/
private $certifications;
/**
* @ORM\Column(type="string", length=255, nullable=true)
* @Groups({"member:read", "member:write", "base:read"})
*/
private $certificationEntity;
/**
* @ORM\Column(type="string", length=255, nullable=true)
* @Groups({"member:read", "member:write", "base:read"})
*/
private $certificationType;
/**
* @ORM\Column(type="date", nullable=true)
* @Groups({"member:read", "member:write", "base:read"})
*/
private $certificationDate;
/**
* @ORM\Column(type="string", length=255, nullable=true)
* @Groups({"member:read", "member:write", "base:read"})
*/
private $yearEstablished;
/**
* @ORM\Column(type="string", length=255, nullable=true)
* @Groups({"member:read", "member:write", "base:read"})
*/
private $qualifyStatus;
/**
* @ORM\Column(type="string", length=255, nullable=true)
* @Groups({"member:read", "member:write", "base:read"})
*/
private $website;
/**
* @ORM\Column(type="integer", nullable=true)
* @Groups({"member:read", "member:write", "base:read"})
*/
private $employees;
/**
* @ORM\Column(type="string", length=100, nullable=true)
* @Groups({"member:read", "member:write", "base:read"})
*/
private $status;
/**
* @ORM\Column(type="string", length=20, nullable=true)
* @Groups({"member:read", "member:write", "base:read"})
*/
private $revenueClass;
/**
* @ORM\Column(type="integer", nullable=true)
* @Groups({"member:read", "member:write", "base:read"})
*/
private $rating;
/**
* @ORM\Column(type="json", nullable=true)
* @Groups({"member:read", "member:write", "base:read"})
*/
private $yourIndustry;
/**
* @ORM\Column(type="string", length=255, nullable=true)
* @Groups({"member:read", "member:write", "base:read"})
*/
private $professionalLicenses;
/**
* @ORM\Column(type="string", length=255, nullable=true)
* @Groups({"member:read", "member:write", "base:read"})
*/
private $dba;
/**
* @ORM\Column(type="datetime", nullable=true)
* @Groups({"member:read", "member:write", "base:read"})
*/
private $createdAt;
/**
* @ORM\Column(type="datetime", nullable=true)
* @Groups({"member:read", "member:write", "base:read"})
*/
private $modifiedAt;
/**
* @ORM\Column(type="string", length=255, nullable=true)
* @Groups({"member:read", "member:write", "base:read"})
*/
private $senate;
/**
* @ORM\Column(type="string", length=255, nullable=true)
* @Groups({"member:read", "member:write", "base:read"})
*/
private $houseOfRepresentatives;
/**
* @ORM\Column(type="string", length=255, nullable=true)
* @Groups({"member:read", "member:write", "base:read"})
*/
private $congressional;
/**
* @ORM\Column(type="string", length=255, nullable=true)
* @Groups({"member:read", "member:write", "base:read"})
*/
private $commissioner;
/**
* @ORM\Column(type="string", length=255, nullable=true)
* @Groups({"member:read", "member:write", "base:read"})
*/
private $schoolBoard;
/**
* @ORM\Column(type="string", length=255, nullable=true)
* @Groups({"member:read", "member:write", "base:read"})
*/
private $cityCouncil;
/**
* @ORM\OneToMany(targetEntity=Order::class, mappedBy="assignedMember")
*/
private $orders;
/**
* @ORM\Column(type="boolean", nullable=true, options={"default": 0})
* @Groups({"member:read", "member:write", "base:read"})
*/
private $deleted = false;
public function __construct()
{
$this->users = new ArrayCollection();
$this->createdAt = new \DateTime('now');
$this->orders = new ArrayCollection();
}
/**
* @ORM\PreUpdate
*/
public function PreUpdate(PreUpdateEventArgs $event)
{
$this->modifiedAt = new \DateTime('now');
}
public function getId(): ?int
{
return $this->id;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(string $name): self
{
$this->name = $name;
return $this;
}
public function getFirstName(): ?string
{
return $this->firstName;
}
public function setFirstName(?string $firstName): self
{
$this->firstName = $firstName;
return $this;
}
public function getLastName(): ?string
{
return $this->lastName;
}
public function setLastName(?string $lastName): self
{
$this->lastName = $lastName;
return $this;
}
public function getEmail(): ?string
{
return $this->email;
}
public function setEmail(?string $email): self
{
$this->email = $email;
return $this;
}
public function getPhone(): ?string
{
return $this->phone;
}
public function setPhone(?string $phone): self
{
$this->phone = $phone;
return $this;
}
public function getFei(): ?string
{
return $this->fei;
}
public function setFei(?string $fei): self
{
$this->fei = $fei;
return $this;
}
public function getStreet(): ?string
{
return $this->street;
}
public function setStreet(?string $street): self
{
$this->street = $street;
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 getZip(): ?string
{
return $this->zip;
}
public function setZip(?string $zip): self
{
$this->zip = $zip;
return $this;
}
public function getIndustry(): ?string
{
return $this->industry;
}
public function setIndustry(?string $industry): self
{
$this->industry = $industry;
return $this;
}
public function getEthnicity(): ?string
{
return $this->ethnicity;
}
public function setEthnicity(?string $ethnicity): self
{
$this->ethnicity = $ethnicity;
return $this;
}
public function getExternalId(): ?string
{
return $this->externalId;
}
public function setExternalId(?string $externalId): self
{
$this->externalId = $externalId;
return $this;
}
public function getRevenue(): ?string
{
return $this->revenue;
}
public function setRevenue(?string $revenue): self
{
$this->revenue = $revenue;
return $this;
}
public function getType(): ?string
{
return $this->type;
}
public function setType(?string $type): self
{
$this->type = $type;
return $this;
}
public function getGender(): ?string
{
return $this->gender;
}
public function setGender(?string $gender): self
{
$this->gender = $gender;
return $this;
}
public function getBusinessType(): ?string
{
return $this->businessType;
}
public function setBusinessType(?string $businessType): self
{
$this->businessType = $businessType;
return $this;
}
public function getBusinessStructure(): ?string
{
return $this->businessStructure;
}
public function setBusinessStructure(?string $businessStructure): self
{
$this->businessStructure = $businessStructure;
return $this;
}
public function getGeographicMarket(): ?string
{
return $this->geographicMarket;
}
public function setGeographicMarket(?string $geographicMarket): self
{
$this->geographicMarket = $geographicMarket;
return $this;
}
/**
* @return Collection<int, User>
*/
public function getUsers(): Collection
{
return $this->users;
}
public function addUser(User $user): self
{
if (!$this->users->contains($user)) {
$this->users[] = $user;
$user->setMember($this);
}
return $this;
}
public function removeUser(User $user): self
{
if ($this->users->removeElement($user)) {
// set the owning side to null (unless already changed)
if ($user->getMember() === $this) {
$user->setMember(null);
}
}
return $this;
}
public function getDescription(): ?string
{
return $this->description;
}
public function setDescription(?string $description): self
{
$this->description = $description;
return $this;
}
public function getNaics(): ?string
{
return $this->naics;
}
public function setNaics(?string $naics): self
{
$this->naics = $naics;
return $this;
}
public function getNigp(): ?string
{
return $this->nigp;
}
public function setNigp(?string $nigp): self
{
$this->nigp = $nigp;
return $this;
}
public function getKeywords(): ?string
{
return $this->keywords;
}
public function setKeywords(?string $keywords): self
{
$this->keywords = $keywords;
return $this;
}
public function getCertifications(): ?string
{
return $this->certifications;
}
public function setCertifications(?string $certifications): self
{
$this->certifications = $certifications;
return $this;
}
public function getCertificationEntity(): ?string
{
return $this->certificationEntity;
}
public function setCertificationEntity(?string $certificationEntity): self
{
$this->certificationEntity = $certificationEntity;
return $this;
}
public function getCertificationType(): ?string
{
return $this->certificationType;
}
public function setCertificationType(?string $certificationType): self
{
$this->certificationType = $certificationType;
return $this;
}
public function getCertificationDate(): ?\DateTimeInterface
{
return $this->certificationDate;
}
public function setCertificationDate(?\DateTimeInterface $certificationDate): self
{
$this->certificationDate = $certificationDate;
return $this;
}
public function getYearEstablished(): ?string
{
return $this->yearEstablished;
}
public function setYearEstablished(?string $yearEstablished): self
{
$this->yearEstablished = $yearEstablished;
return $this;
}
public function getQualifyStatus(): ?string
{
return $this->qualifyStatus;
}
public function setQualifyStatus(?string $qualifyStatus): self
{
$this->qualifyStatus = $qualifyStatus;
return $this;
}
public function getWebsite(): ?string
{
return $this->website;
}
public function setWebsite(?string $website): self
{
$this->website = $website;
return $this;
}
public function getEmployees(): ?int
{
return $this->employees;
}
public function setEmployees(?int $employees): self
{
$this->employees = $employees;
return $this;
}
public function getStatus(): ?string
{
return $this->status;
}
public function setStatus(?string $status): self
{
$this->status = $status;
return $this;
}
public function getRevenueClass(): ?string
{
return $this->revenueClass;
}
public function setRevenueClass(?string $revenueClass): self
{
$this->revenueClass = $revenueClass;
return $this;
}
public function getRating(): ?int
{
return $this->rating;
}
public function setRating(?int $rating): self
{
$this->rating = $rating;
return $this;
}
public function getYourIndustry()
{
return $this->yourIndustry;
}
public function setYourIndustry($yourIndustry): self
{
$this->yourIndustry = $yourIndustry;
return $this;
}
public function getProfessionalLicenses(): ?string
{
return $this->professionalLicenses;
}
public function setProfessionalLicenses(?string $professionalLicenses): self
{
$this->professionalLicenses = $professionalLicenses;
return $this;
}
public function getDba(): ?string
{
return $this->dba;
}
public function setDba(?string $dba): self
{
$this->dba = $dba;
return $this;
}
public function getCreatedAt(): ?\DateTimeInterface
{
return $this->createdAt;
}
public function setCreatedAt(\DateTimeInterface $createdAt): self
{
$this->createdAt = $createdAt;
return $this;
}
public function getModifiedAt(): ?\DateTimeInterface
{
return $this->modifiedAt;
}
public function setModifiedAt(?\DateTimeInterface $modifiedAt): self
{
$this->modifiedAt = $modifiedAt;
return $this;
}
public function getSenate(): ?string
{
return $this->senate;
}
public function setSenate(string $senate): self
{
$this->senate = $senate;
return $this;
}
public function getHouseOfRepresentatives(): ?string
{
return $this->houseOfRepresentatives;
}
public function setHouseOfRepresentatives(string $houseOfRepresentatives): self
{
$this->houseOfRepresentatives = $houseOfRepresentatives;
return $this;
}
public function getCongressional(): ?string
{
return $this->congressional;
}
public function setCongressional(string $congressional): self
{
$this->congressional = $congressional;
return $this;
}
public function getCommissioner(): ?string
{
return $this->commissioner;
}
public function setCommissioner(string $commissioner): self
{
$this->commissioner = $commissioner;
return $this;
}
public function getSchoolBoard(): ?string
{
return $this->schoolBoard;
}
public function setSchoolBoard(string $schoolBoard): self
{
$this->schoolBoard = $schoolBoard;
return $this;
}
public function getCityCouncil(): ?string
{
return $this->cityCouncil;
}
public function setCityCouncil(string $cityCouncil): self
{
$this->cityCouncil = $cityCouncil;
return $this;
}
public function isDeleted(): ?bool
{
return $this->deleted;
}
public function setDeleted(?bool $deleted): self
{
$this->deleted = $deleted;
return $this;
}
/**
* @return Collection<int, Order>
*/
public function getOrders(): Collection
{
return $this->orders;
}
public function addOrder(Order $order): self
{
if (!$this->orders->contains($order)) {
$this->orders[] = $order;
$order->setAssignedMember($this);
}
return $this;
}
public function removeOrder(Order $order): self
{
if ($this->orders->removeElement($order)) {
// set the owning side to null (unless already changed)
if ($order->getAssignedMember() === $this) {
$order->setAssignedMember(null);
}
}
return $this;
}
}