src/Entity/Member.php line 32

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use ApiPlatform\Core\Annotation\ApiResource;
  4. use ApiPlatform\Core\Annotation\ApiFilter;
  5. use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\SearchFilter;
  6. use App\Repository\MemberRepository;
  7. use Doctrine\Common\Collections\ArrayCollection;
  8. use Doctrine\Common\Collections\Collection;
  9. use Doctrine\ORM\Event\PreUpdateEventArgs;
  10. use Doctrine\ORM\Mapping as ORM;
  11. use Symfony\Component\Serializer\Annotation\Groups;
  12. /**
  13.  * @ORM\Entity(repositoryClass=MemberRepository::class)
  14.  * @ORM\HasLifecycleCallbacks()
  15.  * @ORM\EntityListeners({"App\EventListener\MemberListener"})
  16.  * @ApiResource(
  17.  *     normalizationContext={"groups"={"member:read", "base:read", "assign:read"}},
  18.  *     denormalizationContext={"groups"={"member:write", "base:write", "assign:write"}},
  19.  * )
  20.  * @ApiFilter(
  21.  *     SearchFilter::class,
  22.  *     properties={
  23.  *          "externalId": "exact",
  24.  *          "createdAt": "partial",
  25.  *          "modifiedAt": "partial",
  26.  *     }
  27.  * )
  28.  */
  29. class Member
  30. {
  31.     /**
  32.      * @ORM\Id
  33.      * @ORM\GeneratedValue
  34.      * @ORM\Column(type="integer")
  35.      * @Groups({"member:read", "base:read"})
  36.      */
  37.     private $id;
  38.     /**
  39.      * @ORM\Column(type="string", length=255)
  40.      * @Groups({"member:read", "member:write", "base:read"})
  41.      */
  42.     private $name;
  43.     /**
  44.      * @ORM\Column(type="string", length=255, nullable=true)
  45.      * @Groups({"member:read", "member:write", "base:read"})
  46.      */
  47.     private $firstName;
  48.     /**
  49.      * @ORM\Column(type="string", length=255, nullable=true)
  50.      * @Groups({"member:read", "member:write", "base:read"})
  51.      */
  52.     private $lastName;
  53.     /**
  54.      * @ORM\Column(type="string", length=255, nullable=true)
  55.      * @Groups({"member:read", "member:write", "base:read"})
  56.      */
  57.     private $email;
  58.     /**
  59.      * @ORM\Column(type="string", length=255, nullable=true)
  60.      * @Groups({"member:read", "member:write", "base:read"})
  61.      */
  62.     private $phone;
  63.     /**
  64.      * @ORM\Column(type="string", length=255, nullable=true)
  65.      * @Groups({"member:read", "member:write", "base:read"})
  66.      */
  67.     private $fei;
  68.     /**
  69.      * @ORM\Column(type="string", length=255, nullable=true)
  70.      * @Groups({"member:read", "member:write", "base:read"})
  71.      */
  72.     private $street;
  73.     /**
  74.      * @ORM\Column(type="string", length=255, nullable=true)
  75.      * @Groups({"member:read", "member:write", "base:read"})
  76.      */
  77.     private $city;
  78.     /**
  79.      * @ORM\Column(type="string", length=255, nullable=true)
  80.      * @Groups({"member:read", "member:write", "base:read"})
  81.      */
  82.     private $state;
  83.     /**
  84.      * @ORM\Column(type="string", length=255, nullable=true)
  85.      * @Groups({"member:read", "member:write", "base:read"})
  86.      */
  87.     private $zip;
  88.     /**
  89.      * @ORM\Column(type="string", length=255, nullable=true)
  90.      * @Groups({"member:read", "member:write", "base:read"})
  91.      */
  92.     private $industry;
  93.     /**
  94.      * @ORM\Column(type="string", length=100, nullable=true)
  95.      * @Groups({"member:read", "member:write", "base:read"})
  96.      */
  97.     private $ethnicity;
  98.     /**
  99.      * @ORM\Column(type="string", length=36, nullable=true)
  100.      * @Groups({"member:read", "member:write", "base:read"})
  101.      */
  102.     private $externalId;
  103.     /**
  104.      * @ORM\Column(type="decimal", precision=20, scale=2, nullable=true)
  105.      * @Groups({"member:read", "member:write", "base:read"})
  106.      */
  107.     private $revenue;
  108.     /**
  109.      * @ORM\Column(type="string", length=100, nullable=true)
  110.      * @Groups({"member:read", "member:write", "base:read"})
  111.      */
  112.     private $type;
  113.     /**
  114.      * @ORM\Column(type="string", length=50, nullable=true)
  115.      * @Groups({"member:read", "member:write", "base:read"})
  116.      */
  117.     private $gender;
  118.     /**
  119.      * @ORM\Column(type="string", length=255, nullable=true)
  120.      * @Groups({"member:read", "member:write", "base:read"})
  121.      */
  122.     private $businessType;
  123.     /**
  124.      * @ORM\Column(type="string", length=255, nullable=true)
  125.      * @Groups({"member:read", "member:write", "base:read"})
  126.      */
  127.     private $businessStructure;
  128.     /**
  129.      * @ORM\Column(type="string", length=100, nullable=true)
  130.      * @Groups({"member:read", "member:write", "base:read"})
  131.      */
  132.     private $geographicMarket;
  133.     /**
  134.      * @ORM\OneToMany(targetEntity=User::class, mappedBy="member")
  135.      */
  136.     private $users;
  137.     /**
  138.      * @ORM\Column(type="text", nullable=true)
  139.      * @Groups({"member:read", "member:write", "base:read"})
  140.      */
  141.     private $description;
  142.     /**
  143.      * @ORM\Column(type="string", length=255, nullable=true)
  144.      * @Groups({"member:read", "member:write", "base:read"})
  145.      */
  146.     private $naics;
  147.     /**
  148.      * @ORM\Column(type="string", length=255, nullable=true)
  149.      * @Groups({"member:read", "member:write", "base:read"})
  150.      */
  151.     private $nigp;
  152.     /**
  153.      * @ORM\Column(type="text", nullable=true)
  154.      * @Groups({"member:read", "member:write", "base:read"})
  155.      */
  156.     private $keywords;
  157.     /**
  158.      * @ORM\Column(type="string", length=255, nullable=true)
  159.      * @Groups({"member:read", "member:write", "base:read"})
  160.      */
  161.     private $certifications;
  162.     /**
  163.      * @ORM\Column(type="string", length=255, nullable=true)
  164.      * @Groups({"member:read", "member:write", "base:read"})
  165.      */
  166.     private $certificationEntity;
  167.     /**
  168.      * @ORM\Column(type="string", length=255, nullable=true)
  169.      * @Groups({"member:read", "member:write", "base:read"})
  170.      */
  171.     private $certificationType;
  172.     /**
  173.      * @ORM\Column(type="date", nullable=true)
  174.      * @Groups({"member:read", "member:write", "base:read"})
  175.      */
  176.     private $certificationDate;
  177.     /**
  178.      * @ORM\Column(type="string", length=255, nullable=true)
  179.      * @Groups({"member:read", "member:write", "base:read"})
  180.      */
  181.     private $yearEstablished;
  182.     /**
  183.      * @ORM\Column(type="string", length=255, nullable=true)
  184.      * @Groups({"member:read", "member:write", "base:read"})
  185.      */
  186.     private $qualifyStatus;
  187.     /**
  188.      * @ORM\Column(type="string", length=255, nullable=true)
  189.      * @Groups({"member:read", "member:write", "base:read"})
  190.      */
  191.     private $website;
  192.     /**
  193.      * @ORM\Column(type="integer", nullable=true)
  194.      * @Groups({"member:read", "member:write", "base:read"})
  195.      */
  196.     private $employees;
  197.     /**
  198.      * @ORM\Column(type="string", length=100, nullable=true)
  199.      * @Groups({"member:read", "member:write", "base:read"})
  200.      */
  201.     private $status;
  202.     /**
  203.      * @ORM\Column(type="string", length=20, nullable=true)
  204.      * @Groups({"member:read", "member:write", "base:read"})
  205.      */
  206.     private $revenueClass;
  207.     /**
  208.      * @ORM\Column(type="integer", nullable=true)
  209.      * @Groups({"member:read", "member:write", "base:read"})
  210.      */
  211.     private $rating;
  212.     /**
  213.      * @ORM\Column(type="json", nullable=true)
  214.      * @Groups({"member:read", "member:write", "base:read"})
  215.      */
  216.     private $yourIndustry;
  217.     /**
  218.      * @ORM\Column(type="string", length=255, nullable=true)
  219.      * @Groups({"member:read", "member:write", "base:read"})
  220.      */
  221.     private $professionalLicenses;
  222.     /**
  223.      * @ORM\Column(type="string", length=255, nullable=true)
  224.      * @Groups({"member:read", "member:write", "base:read"})
  225.      */
  226.     private $dba;
  227.     /**
  228.      * @ORM\Column(type="datetime", nullable=true)
  229.      * @Groups({"member:read", "member:write", "base:read"})
  230.      */
  231.     private $createdAt;
  232.     /**
  233.      * @ORM\Column(type="datetime", nullable=true)
  234.      * @Groups({"member:read", "member:write", "base:read"})
  235.      */
  236.     private $modifiedAt;
  237.     /**
  238.      * @ORM\Column(type="string", length=255, nullable=true)
  239.      * @Groups({"member:read", "member:write", "base:read"})
  240.      */
  241.     private $senate;
  242.     /**
  243.      * @ORM\Column(type="string", length=255, nullable=true)
  244.      * @Groups({"member:read", "member:write", "base:read"})
  245.      */
  246.     private $houseOfRepresentatives;
  247.     /**
  248.      * @ORM\Column(type="string", length=255, nullable=true)
  249.      * @Groups({"member:read", "member:write", "base:read"})
  250.      */
  251.     private $congressional;
  252.     /**
  253.      * @ORM\Column(type="string", length=255, nullable=true)
  254.      * @Groups({"member:read", "member:write", "base:read"})
  255.      */
  256.     private $commissioner;
  257.     /**
  258.      * @ORM\Column(type="string", length=255, nullable=true)
  259.      * @Groups({"member:read", "member:write", "base:read"})
  260.      */
  261.     private $schoolBoard;
  262.     /**
  263.      * @ORM\Column(type="string", length=255, nullable=true)
  264.      * @Groups({"member:read", "member:write", "base:read"})
  265.      */
  266.     private $cityCouncil;
  267.     /**
  268.      * @ORM\OneToMany(targetEntity=Order::class, mappedBy="assignedMember")
  269.      */
  270.     private $orders;
  271.     /**
  272.      * @ORM\Column(type="boolean", nullable=true, options={"default": 0})
  273.      * @Groups({"member:read", "member:write", "base:read"})
  274.      */
  275.     private $deleted false;
  276.     public function __construct()
  277.     {
  278.         $this->users = new ArrayCollection();
  279.         $this->createdAt = new \DateTime('now');
  280.         $this->orders = new ArrayCollection();
  281.     }
  282.     /**
  283.      * @ORM\PreUpdate
  284.      */
  285.     public function PreUpdate(PreUpdateEventArgs $event)
  286.     {
  287.         $this->modifiedAt = new \DateTime('now');
  288.     }
  289.     public function getId(): ?int
  290.     {
  291.         return $this->id;
  292.     }
  293.     public function getName(): ?string
  294.     {
  295.         return $this->name;
  296.     }
  297.     public function setName(string $name): self
  298.     {
  299.         $this->name $name;
  300.         return $this;
  301.     }
  302.     public function getFirstName(): ?string
  303.     {
  304.         return $this->firstName;
  305.     }
  306.     public function setFirstName(?string $firstName): self
  307.     {
  308.         $this->firstName $firstName;
  309.         return $this;
  310.     }
  311.     public function getLastName(): ?string
  312.     {
  313.         return $this->lastName;
  314.     }
  315.     public function setLastName(?string $lastName): self
  316.     {
  317.         $this->lastName $lastName;
  318.         return $this;
  319.     }
  320.     public function getEmail(): ?string
  321.     {
  322.         return $this->email;
  323.     }
  324.     public function setEmail(?string $email): self
  325.     {
  326.         $this->email $email;
  327.         return $this;
  328.     }
  329.     public function getPhone(): ?string
  330.     {
  331.         return $this->phone;
  332.     }
  333.     public function setPhone(?string $phone): self
  334.     {
  335.         $this->phone $phone;
  336.         return $this;
  337.     }
  338.     public function getFei(): ?string
  339.     {
  340.         return $this->fei;
  341.     }
  342.     public function setFei(?string $fei): self
  343.     {
  344.         $this->fei $fei;
  345.         return $this;
  346.     }
  347.     public function getStreet(): ?string
  348.     {
  349.         return $this->street;
  350.     }
  351.     public function setStreet(?string $street): self
  352.     {
  353.         $this->street $street;
  354.         return $this;
  355.     }
  356.     public function getCity(): ?string
  357.     {
  358.         return $this->city;
  359.     }
  360.     public function setCity(?string $city): self
  361.     {
  362.         $this->city $city;
  363.         return $this;
  364.     }
  365.     public function getState(): ?string
  366.     {
  367.         return $this->state;
  368.     }
  369.     public function setState(?string $state): self
  370.     {
  371.         $this->state $state;
  372.         return $this;
  373.     }
  374.     public function getZip(): ?string
  375.     {
  376.         return $this->zip;
  377.     }
  378.     public function setZip(?string $zip): self
  379.     {
  380.         $this->zip $zip;
  381.         return $this;
  382.     }
  383.     public function getIndustry(): ?string
  384.     {
  385.         return $this->industry;
  386.     }
  387.     public function setIndustry(?string $industry): self
  388.     {
  389.         $this->industry $industry;
  390.         return $this;
  391.     }
  392.     public function getEthnicity(): ?string
  393.     {
  394.         return $this->ethnicity;
  395.     }
  396.     public function setEthnicity(?string $ethnicity): self
  397.     {
  398.         $this->ethnicity $ethnicity;
  399.         return $this;
  400.     }
  401.     public function getExternalId(): ?string
  402.     {
  403.         return $this->externalId;
  404.     }
  405.     public function setExternalId(?string $externalId): self
  406.     {
  407.         $this->externalId $externalId;
  408.         return $this;
  409.     }
  410.     public function getRevenue(): ?string
  411.     {
  412.         return $this->revenue;
  413.     }
  414.     public function setRevenue(?string $revenue): self
  415.     {
  416.         $this->revenue $revenue;
  417.         return $this;
  418.     }
  419.     public function getType(): ?string
  420.     {
  421.         return $this->type;
  422.     }
  423.     public function setType(?string $type): self
  424.     {
  425.         $this->type $type;
  426.         return $this;
  427.     }
  428.     public function getGender(): ?string
  429.     {
  430.         return $this->gender;
  431.     }
  432.     public function setGender(?string $gender): self
  433.     {
  434.         $this->gender $gender;
  435.         return $this;
  436.     }
  437.     public function getBusinessType(): ?string
  438.     {
  439.         return $this->businessType;
  440.     }
  441.     public function setBusinessType(?string $businessType): self
  442.     {
  443.         $this->businessType $businessType;
  444.         return $this;
  445.     }
  446.     public function getBusinessStructure(): ?string
  447.     {
  448.         return $this->businessStructure;
  449.     }
  450.     public function setBusinessStructure(?string $businessStructure): self
  451.     {
  452.         $this->businessStructure $businessStructure;
  453.         return $this;
  454.     }
  455.     public function getGeographicMarket(): ?string
  456.     {
  457.         return $this->geographicMarket;
  458.     }
  459.     public function setGeographicMarket(?string $geographicMarket): self
  460.     {
  461.         $this->geographicMarket $geographicMarket;
  462.         return $this;
  463.     }
  464.     /**
  465.      * @return Collection<int, User>
  466.      */
  467.     public function getUsers(): Collection
  468.     {
  469.         return $this->users;
  470.     }
  471.     public function addUser(User $user): self
  472.     {
  473.         if (!$this->users->contains($user)) {
  474.             $this->users[] = $user;
  475.             $user->setMember($this);
  476.         }
  477.         return $this;
  478.     }
  479.     public function removeUser(User $user): self
  480.     {
  481.         if ($this->users->removeElement($user)) {
  482.             // set the owning side to null (unless already changed)
  483.             if ($user->getMember() === $this) {
  484.                 $user->setMember(null);
  485.             }
  486.         }
  487.         return $this;
  488.     }
  489.     public function getDescription(): ?string
  490.     {
  491.         return $this->description;
  492.     }
  493.     public function setDescription(?string $description): self
  494.     {
  495.         $this->description $description;
  496.         return $this;
  497.     }
  498.     public function getNaics(): ?string
  499.     {
  500.         return $this->naics;
  501.     }
  502.     public function setNaics(?string $naics): self
  503.     {
  504.         $this->naics $naics;
  505.         return $this;
  506.     }
  507.     public function getNigp(): ?string
  508.     {
  509.         return $this->nigp;
  510.     }
  511.     public function setNigp(?string $nigp): self
  512.     {
  513.         $this->nigp $nigp;
  514.         return $this;
  515.     }
  516.     public function getKeywords(): ?string
  517.     {
  518.         return $this->keywords;
  519.     }
  520.     public function setKeywords(?string $keywords): self
  521.     {
  522.         $this->keywords $keywords;
  523.         return $this;
  524.     }
  525.     public function getCertifications(): ?string
  526.     {
  527.         return $this->certifications;
  528.     }
  529.     public function setCertifications(?string $certifications): self
  530.     {
  531.         $this->certifications $certifications;
  532.         return $this;
  533.     }
  534.     public function getCertificationEntity(): ?string
  535.     {
  536.         return $this->certificationEntity;
  537.     }
  538.     public function setCertificationEntity(?string $certificationEntity): self
  539.     {
  540.         $this->certificationEntity $certificationEntity;
  541.         return $this;
  542.     }
  543.     public function getCertificationType(): ?string
  544.     {
  545.         return $this->certificationType;
  546.     }
  547.     public function setCertificationType(?string $certificationType): self
  548.     {
  549.         $this->certificationType $certificationType;
  550.         return $this;
  551.     }
  552.     public function getCertificationDate(): ?\DateTimeInterface
  553.     {
  554.         return $this->certificationDate;
  555.     }
  556.     public function setCertificationDate(?\DateTimeInterface $certificationDate): self
  557.     {
  558.         $this->certificationDate $certificationDate;
  559.         return $this;
  560.     }
  561.     public function getYearEstablished(): ?string
  562.     {
  563.         return $this->yearEstablished;
  564.     }
  565.     public function setYearEstablished(?string $yearEstablished): self
  566.     {
  567.         $this->yearEstablished $yearEstablished;
  568.         return $this;
  569.     }
  570.     public function getQualifyStatus(): ?string
  571.     {
  572.         return $this->qualifyStatus;
  573.     }
  574.     public function setQualifyStatus(?string $qualifyStatus): self
  575.     {
  576.         $this->qualifyStatus $qualifyStatus;
  577.         return $this;
  578.     }
  579.     public function getWebsite(): ?string
  580.     {
  581.         return $this->website;
  582.     }
  583.     public function setWebsite(?string $website): self
  584.     {
  585.         $this->website $website;
  586.         return $this;
  587.     }
  588.     public function getEmployees(): ?int
  589.     {
  590.         return $this->employees;
  591.     }
  592.     public function setEmployees(?int $employees): self
  593.     {
  594.         $this->employees $employees;
  595.         return $this;
  596.     }
  597.     public function getStatus(): ?string
  598.     {
  599.         return $this->status;
  600.     }
  601.     public function setStatus(?string $status): self
  602.     {
  603.         $this->status $status;
  604.         return $this;
  605.     }
  606.     public function getRevenueClass(): ?string
  607.     {
  608.         return $this->revenueClass;
  609.     }
  610.     public function setRevenueClass(?string $revenueClass): self
  611.     {
  612.         $this->revenueClass $revenueClass;
  613.         return $this;
  614.     }
  615.     public function getRating(): ?int
  616.     {
  617.         return $this->rating;
  618.     }
  619.     public function setRating(?int $rating): self
  620.     {
  621.         $this->rating $rating;
  622.         return $this;
  623.     }
  624.     public function getYourIndustry()
  625.     {
  626.         return $this->yourIndustry;
  627.     }
  628.     public function setYourIndustry($yourIndustry): self
  629.     {
  630.         $this->yourIndustry $yourIndustry;
  631.         return $this;
  632.     }
  633.     public function getProfessionalLicenses(): ?string
  634.     {
  635.         return $this->professionalLicenses;
  636.     }
  637.     public function setProfessionalLicenses(?string $professionalLicenses): self
  638.     {
  639.         $this->professionalLicenses $professionalLicenses;
  640.         return $this;
  641.     }
  642.     public function getDba(): ?string
  643.     {
  644.         return $this->dba;
  645.     }
  646.     public function setDba(?string $dba): self
  647.     {
  648.         $this->dba $dba;
  649.         return $this;
  650.     }
  651.     public function getCreatedAt(): ?\DateTimeInterface
  652.     {
  653.         return $this->createdAt;
  654.     }
  655.     public function setCreatedAt(\DateTimeInterface $createdAt): self
  656.     {
  657.         $this->createdAt $createdAt;
  658.         return $this;
  659.     }
  660.     public function getModifiedAt(): ?\DateTimeInterface
  661.     {
  662.         return $this->modifiedAt;
  663.     }
  664.     public function setModifiedAt(?\DateTimeInterface $modifiedAt): self
  665.     {
  666.         $this->modifiedAt $modifiedAt;
  667.         return $this;
  668.     }
  669.     public function getSenate(): ?string
  670.     {
  671.         return $this->senate;
  672.     }
  673.     public function setSenate(string $senate): self
  674.     {
  675.         $this->senate $senate;
  676.         return $this;
  677.     }
  678.     public function getHouseOfRepresentatives(): ?string
  679.     {
  680.         return $this->houseOfRepresentatives;
  681.     }
  682.     public function setHouseOfRepresentatives(string $houseOfRepresentatives): self
  683.     {
  684.         $this->houseOfRepresentatives $houseOfRepresentatives;
  685.         return $this;
  686.     }
  687.     public function getCongressional(): ?string
  688.     {
  689.         return $this->congressional;
  690.     }
  691.     public function setCongressional(string $congressional): self
  692.     {
  693.         $this->congressional $congressional;
  694.         return $this;
  695.     }
  696.     public function getCommissioner(): ?string
  697.     {
  698.         return $this->commissioner;
  699.     }
  700.     public function setCommissioner(string $commissioner): self
  701.     {
  702.         $this->commissioner $commissioner;
  703.         return $this;
  704.     }
  705.     public function getSchoolBoard(): ?string
  706.     {
  707.         return $this->schoolBoard;
  708.     }
  709.     public function setSchoolBoard(string $schoolBoard): self
  710.     {
  711.         $this->schoolBoard $schoolBoard;
  712.         return $this;
  713.     }
  714.     public function getCityCouncil(): ?string
  715.     {
  716.         return $this->cityCouncil;
  717.     }
  718.     public function setCityCouncil(string $cityCouncil): self
  719.     {
  720.         $this->cityCouncil $cityCouncil;
  721.         return $this;
  722.     }
  723.     public function isDeleted(): ?bool
  724.     {
  725.         return $this->deleted;
  726.     }
  727.     public function setDeleted(?bool $deleted): self
  728.     {
  729.         $this->deleted $deleted;
  730.         return $this;
  731.     }
  732.     /**
  733.      * @return Collection<int, Order>
  734.      */
  735.     public function getOrders(): Collection
  736.     {
  737.         return $this->orders;
  738.     }
  739.     public function addOrder(Order $order): self
  740.     {
  741.         if (!$this->orders->contains($order)) {
  742.             $this->orders[] = $order;
  743.             $order->setAssignedMember($this);
  744.         }
  745.         return $this;
  746.     }
  747.     public function removeOrder(Order $order): self
  748.     {
  749.         if ($this->orders->removeElement($order)) {
  750.             // set the owning side to null (unless already changed)
  751.             if ($order->getAssignedMember() === $this) {
  752.                 $order->setAssignedMember(null);
  753.             }
  754.         }
  755.         return $this;
  756.     }
  757. }