src/Entity/Contact.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\Common\Collections\Collection;
  5. use Doctrine\ORM\Mapping as ORM;
  6. /**
  7.  * @ORM\Entity(repositoryClass="App\Repository\ContactRepository")
  8.  */
  9. class Contact
  10. {
  11.     
  12.     const STATUS_SPAM = -1;
  13.     const STATUS_INACTIVE 0;
  14.     const STATUS_ACTIVE 1;
  15.     const LIST_OF_STATES = [
  16.         "AL" => "Alabama",
  17.         "AK" => "Alaska",
  18.         "AZ" => "Arizona",
  19.         "AR" => "Arkansas",
  20.         "CA" => "California",
  21.         "CO" => "Colorado",
  22.         "CT" => "Connecticut",
  23.         "DE" => "Delaware",
  24.         "FL" => "Florida",
  25.         "GA" => "Georgia",
  26.         "HI" => "Hawaii",
  27.         "ID" => "Idaho",
  28.         "IL" => "Illinois",
  29.         "IN" => "Indiana",
  30.         "IA" => "Iowa",
  31.         "KS" => "Kansas",
  32.         "KY" => "Kentucky",
  33.         "LA" => "Louisiana",
  34.         "ME" => "Maine",
  35.         "MD" => "Maryland",
  36.         "MA" => "Massachusetts",
  37.         "MI" => "Michigan",
  38.         "MN" => "Minnesota",
  39.         "MS" => "Mississippi",
  40.         "MO" => "Missouri",
  41.         "MT" => "Montana",
  42.         "NE" => "Nebraska",
  43.         "NV" => "Nevada",
  44.         "NH" => "New Hampshire",
  45.         "NJ" => "New Jersey",
  46.         "NM" => "New Mexico",
  47.         "NY" => "New York",
  48.         "NC" => "North Carolina",
  49.         "ND" => "North Dakota",
  50.         "OH" => "Ohio",
  51.         "OK" => "Oklahoma",
  52.         "OR" => "Oregon",
  53.         "PA" => "Pennsylvania",
  54.         "RI" => "Rhode Island",
  55.         "SC" => "South Carolina",
  56.         "SD" => "South Dakota",
  57.         "TN" => "Tennessee",
  58.         "TX" => "Texas",
  59.         "UT" => "Utah",
  60.         "VT" => "Vermont",
  61.         "VA" => "Virginia",
  62.         "WA" => "Washington",
  63.         "WV" => "West Virginia",
  64.         "WI" => "Wisconsin",
  65.         "WY" => "Wyoming",
  66.         "AS" => "American Samoa",
  67.         "GU" => "Guam",
  68.         "MP" => "Northern Mariana Islands",
  69.         "PR" => "Puerto Rico",
  70.         "VI" => "US Virgin Islands",
  71.         "DC" => "Washington, DC",
  72.         "CA-AB" => "Alberta",
  73.         "CA-BC" => "British Columbia",
  74.         "CA-MB" => "Manitoba",
  75.         "CA-NB" => "New Brunswick",
  76.         "CA-NL" => "Newfoundland and Labrador",
  77.         "CA-NT" => "Northwest Territories",
  78.         "CA-NS" => "Nova Scotia",
  79.         "CA-NU" => "Nunavut",
  80.         "CA-ON" => "Ontario",
  81.         "CA-PE" => "Prince Edward Island",
  82.         "CA-QC" => "Quebec",
  83.         "CA-SK" => "Saskatchewan",
  84.         "CA-YT" => "Yukon",
  85.         "MX-AG" => "Aguascalientes",
  86.         "MX-BC" => "Baja California",
  87.         "MX-BS" => "Baja California Sur",
  88.         "MX-CH" => "Chihuahua",
  89.         "MX-CL" => "Colima",
  90.         "MX-CM" => "Campeche",
  91.         "MX-CO" => "Coahuila",
  92.         "MX-CS" => "Chiapas",
  93.         "MX-DF" => "Federal District",
  94.         "MX-DG" => "Durango",
  95.         "MX-GR" => "Guerrero",
  96.         "MX-GT" => "Guanajuato",
  97.         "MX-HG" => "Hidalgo",
  98.         "MX-JA" => "Jalisco",
  99.         "MX-ME" => "México State",
  100.         "MX-MI" => "Michoacán",
  101.         "MX-MO" => "Morelos",
  102.         "MX-NA" => "Nayarit",
  103.         "MX-NL" => "Nuevo León",
  104.         "MX-OA" => "Oaxaca",
  105.         "MX-PB" => "Puebla",
  106.         "MX-QE" => "Querétaro",
  107.         "MX-QR" => "Quintana Roo",
  108.         "MX-SI" => "Sinaloa",
  109.         "MX-SL" => "San Luis Potosí",
  110.         "MX-SO" => "Sonora",
  111.         "MX-TB" => "Tabasco",
  112.         "MX-TL" => "Tlaxcala",
  113.         "MX-TM" => "Tamaulipas",
  114.         "MX-VE" => "Veracruz",
  115.         "MX-YU" => "Yucatán",
  116.         "MX-ZA" => "Zacatecas",
  117.     ];
  118.     /**
  119.      * @ORM\Id()
  120.      * @ORM\GeneratedValue()
  121.      * @ORM\Column(type="integer")
  122.      */
  123.     private $id;
  124.     
  125.     /**
  126.      * @ORM\ManyToOne(targetEntity="App\Entity\Contact", inversedBy="children")
  127.      * @ORM\JoinColumn(nullable=true)
  128.      */
  129.     private $prnt;
  130.     
  131.     /**
  132.      * @ORM\OneToMany(targetEntity="App\Entity\Contact", mappedBy="prnt")
  133.      */
  134.     private $children;
  135.     
  136.     /**
  137.      * @ORM\Column(type="string", length=128)
  138.      */
  139.     private $email;
  140.     /**
  141.      * @ORM\Column(type="string", length=64)
  142.      */
  143.     private $firstname;
  144.     /**
  145.      * @ORM\Column(type="string", length=64)
  146.      */
  147.     private $lastname;
  148.     /**
  149.      * @ORM\Column(type="string", length=64)
  150.      */
  151.     private $company;
  152.     /**
  153.      * @ORM\Column(type="string", length=64)
  154.      */
  155.     private $job_title;
  156.     /**
  157.      * @ORM\Column(type="string", length=15)
  158.      */
  159.     private $phone_business;
  160.     /**
  161.      * @ORM\Column(type="string", length=15)
  162.      */
  163.     private $phone_mobile;
  164.     /**
  165.      * @ORM\Column(type="string", length=64)
  166.      */
  167.     private $address1;
  168.     /**
  169.      * @ORM\Column(type="string", length=64)
  170.      */
  171.     private $address2;
  172.     /**
  173.      * @ORM\Column(type="string", length=32)
  174.      */
  175.     private $city;
  176.     /**
  177.      * @ORM\Column(type="string", length=24)
  178.      */
  179.     private $state;
  180.     /**
  181.      * @ORM\Column(type="string", length=10)
  182.      */
  183.     private $zip;
  184.     /**
  185.      * @ORM\Column(type="string", length=4)
  186.      */
  187.     private $last4;
  188.     /**
  189.      * @ORM\Column(type="string", length=48)
  190.      */
  191.     private $country;
  192.     
  193.     /**
  194.      * @ORM\Column(type="string", length=64)
  195.      */
  196.     private $home_address1;
  197.     
  198.     /**
  199.      * @ORM\Column(type="string", length=64)
  200.      */
  201.     private $home_address2;
  202.     
  203.     /**
  204.      * @ORM\Column(type="string", length=32)
  205.      */
  206.     private $home_city;
  207.     
  208.     /**
  209.      * @ORM\Column(type="string", length=24)
  210.      */
  211.     private $home_state;
  212.     
  213.     /**
  214.      * @ORM\Column(type="string", length=10)
  215.      */
  216.     private $home_zip;
  217.     
  218.     /**
  219.      * @ORM\Column(type="string", length=48)
  220.      */
  221.     private $home_country;
  222.     /**
  223.      * @ORM\Column(type="string", length=64)
  224.      */
  225.     private $website;
  226.     
  227.     /**
  228.      * @ORM\Column(type="datetime")
  229.      */
  230.     private $birthday;
  231.     /**
  232.      * @ORM\Column(type="string", length=255)
  233.      */
  234.     private $type_business;
  235.     /**
  236.      * @ORM\Column(type="string", length=24)
  237.      */
  238.     private $type_work;
  239.     /**
  240.      * @ORM\Column(type="datetime")
  241.      */
  242.     private $year_established;
  243.     /**
  244.      * @ORM\Column(type="integer")
  245.      */
  246.     private $employee_size;
  247.     /**
  248.      * @ORM\Column(type="string", length=8)
  249.      */
  250.     private $gender;
  251.     /**
  252.      * @ORM\Column(type="string", length=24)
  253.      */
  254.     private $ethnicity;
  255.     
  256.     /**
  257.      * @ORM\Column(type="string", length=64)
  258.      */
  259.     private $language;
  260.     /**
  261.      * @ORM\Column(type="decimal", precision=10, scale=0)
  262.      */
  263.     private $sales_volume;
  264.     
  265.     /**
  266.      * @ORM\Column(type="string", length=64)
  267.      */
  268.     private $contractor_specialty;
  269.     
  270.     /**
  271.      * @ORM\Column(type="string", length=64)
  272.      */
  273.     private $products_services_specialty;
  274.     /**
  275.      * @ORM\Column(type="datetime")
  276.      */
  277.     private $created_at;
  278.     
  279.     /**
  280.      * @ORM\OneToMany(targetEntity="App\Entity\ContactNote", mappedBy="contact", cascade={"persist"})
  281.      */
  282.     private $contactNotes;
  283.     
  284.     /**
  285.      * @ORM\OneToMany(targetEntity="App\Entity\Lead", mappedBy="contact", cascade={"persist"})
  286.      * @ORM\OrderBy({"id" = "DESC"})
  287.      */
  288.     private $leads;
  289.     
  290.     /**
  291.      * @ORM\OneToMany(targetEntity="App\Entity\User", mappedBy="contact", cascade={"persist"})
  292.      * @ORM\OrderBy({"id" = "DESC"})
  293.      */
  294.     private $users;
  295.     
  296.     /**
  297.      * @ORM\Column(type="string", length=64)
  298.      */
  299.     private $preferred_language;
  300.     
  301.     /**
  302.      * @ORM\Column(type="boolean")
  303.      */
  304.     private $do_not_email;
  305.     
  306.     /**
  307.      * @ORM\Column(type="boolean")
  308.      */
  309.     private $rclub_interest;
  310.     
  311.     /**
  312.      * @ORM\Column(type="integer")
  313.      */
  314.     private $status;
  315.     
  316.     /**
  317.      * @ORM\Column(type="string", length=64)
  318.      */
  319.     private $prospect;
  320.     
  321.     /**
  322.      * @ORM\Column(type="string", length=255)
  323.      */
  324.     private $roofing_materials;
  325.     
  326.     /**
  327.      * @ORM\Column(type="text")
  328.      */
  329.     private $creation_info;
  330.     
  331.     
  332.     public function __construct()
  333.     {
  334.         $this->email "";
  335.         $this->firstname "";
  336.         $this->lastname "";
  337.         $this->company "";
  338.         $this->job_title "";
  339.         $this->phone_business "";
  340.         $this->phone_mobile "";
  341.         $this->address1 "";
  342.         $this->address2 "";
  343.         $this->city "";
  344.         $this->state "";
  345.         $this->zip "";
  346.         $this->last4 "";
  347.         $this->country "";
  348.         $this->home_address1 "";
  349.         $this->home_address2 "";
  350.         $this->home_city "";
  351.         $this->home_state "";
  352.         $this->home_zip "";
  353.         $this->home_country "";
  354.         $this->website "";
  355.         $this->birthday null;
  356.         $this->type_business "";
  357.         $this->type_work "";
  358.         $this->year_established = new \DateTime();
  359.         $this->employee_size 0;
  360.         $this->gender "";
  361.         $this->ethnicity "";
  362.         $this->language "";
  363.         $this->preferred_language "";
  364.         $this->sales_volume 0;
  365.         $this->contractor_specialty "";
  366.         $this->products_services_specialty "";
  367.         $this->created_at = new \DateTime();
  368.         
  369.         $this->leads = new ArrayCollection();
  370.         $this->users = new ArrayCollection();
  371.         
  372.         $this->do_not_email 0;
  373.         $this->rclub_interest 0;
  374.         $this->status SELF::STATUS_ACTIVE;
  375.         $this->prospect "";
  376.         $this->creation_info "";
  377.         $this->roofing_materials "";
  378.         
  379.         $this->children = new ArrayCollection();
  380.         
  381.         $this->contactNotes = new ArrayCollection();
  382.     }
  383.     public function getId()
  384.     {
  385.         return $this->id;
  386.     }
  387.     
  388.     public function getPrnt(): ?self
  389.     {
  390.         return $this->prnt;
  391.     }
  392.     public function setPrnt(?self $prnt): self
  393.     {
  394.         $this->prnt $prnt;
  395.         return $this;
  396.     }
  397.     
  398.     public function getChildren ()
  399.     {
  400.         return $this->children;
  401.     }
  402.     
  403.     public function addChild (Contact $child) {
  404.         if (!$this->children->contains($child)) {
  405.             $this->children[] = $child;
  406.             $child->setPrnt($this);
  407.         }
  408.         
  409.         return $this;
  410.     }
  411.     
  412.     public function removeChild (Contact $child): self
  413.     {
  414.         if ($this->children->contains($child)) {
  415.             $this->children->removeElement($child);
  416.             // set the owning side to null (unless already changed)
  417.             if ($child->getPrnt() === $this) {
  418.                 $child->setPrnt(null);
  419.             }
  420.         }
  421.         
  422.         return $this;
  423.     }
  424.     public function getEmail(): ?string
  425.     {
  426.         return $this->email;
  427.     }
  428.     public function setEmail(string $email null): self
  429.     {
  430.         if (is_null($email)) {
  431.             $email "";
  432.         }
  433.         
  434.         $this->email $email;
  435.         return $this;
  436.     }
  437.     public function getFirstname(): ?string
  438.     {
  439.         return $this->firstname;
  440.     }
  441.     public function setFirstname(string $firstname null): self
  442.     {
  443.         if (is_null($firstname)) {
  444.             $firstname "";
  445.         }
  446.         
  447.         $this->firstname ucwords(strtolower($firstname)); //capitalize each word per ticket #89708
  448.         return $this;
  449.     }
  450.     public function getLastname(): ?string
  451.     {
  452.         return $this->lastname;
  453.     }
  454.     public function setLastname(string $lastname null): self
  455.     {
  456.         if (is_null($lastname)) {
  457.             $lastname "";
  458.         }
  459.         
  460.         $this->lastname ucwords(strtolower($lastname));
  461.         return $this;
  462.     }
  463.     public function getCompany(): ?string
  464.     {
  465.         return $this->company;
  466.     }
  467.     public function setCompany(string $company null): self
  468.     {
  469.         if (is_null($company)) {
  470.             $company "";
  471.         }
  472.         
  473.         $this->company ucwords(strtolower($company));
  474.         return $this;
  475.     }
  476.     public function getJobTitle(): ?string
  477.     {
  478.         return $this->job_title;
  479.     }
  480.     public function setJobTitle(string $job_title null): self
  481.     {
  482.         if (is_null($job_title)) {
  483.             $job_title "";
  484.         }
  485.         
  486.         $this->job_title ucwords(strtolower($job_title));
  487.         return $this;
  488.     }
  489.     public function getPhoneBusiness(): ?string
  490.     {
  491.         return $this->phone_business;
  492.     }
  493.     public function setPhoneBusiness(string $phone_business null): self
  494.     {
  495.         if (is_null($phone_business)) {
  496.             $phone_business "";
  497.         }
  498.         
  499.         $this->phone_business $phone_business;
  500.         return $this;
  501.     }
  502.     public function getPhoneMobile(): ?string
  503.     {
  504.         return $this->phone_mobile;
  505.     }
  506.     public function setPhoneMobile(string $phone_mobile null): self
  507.     {
  508.         if (is_null($phone_mobile)) {
  509.             $phone_mobile "";
  510.         }
  511.         
  512.         $this->phone_mobile $phone_mobile;
  513.         return $this;
  514.     }
  515.     public function getAddress1(): ?string
  516.     {
  517.         return $this->address1;
  518.     }
  519.     public function setAddress1(string $address1 null): self
  520.     {
  521.         if (is_null($address1)) {
  522.             $address1 "";
  523.         }
  524.         
  525.         $this->address1 ucwords(strtolower($address1));
  526.         return $this;
  527.     }
  528.     
  529.     public function getAddress2(): ?string
  530.     {
  531.         return $this->address2;
  532.     }
  533.     public function setAddress2(string $address2 null): self
  534.     {
  535.         if (is_null($address2)) {
  536.             $address2 "";
  537.         }
  538.         
  539.         $this->address2 ucwords(strtolower($address2));
  540.         return $this;
  541.     }
  542.     
  543.     public function getCity(): ?string
  544.     {
  545.         return $this->city;
  546.     }
  547.     public function setCity(string $city null): self
  548.     {
  549.         if (is_null($city)) {
  550.             $city "";
  551.         }
  552.         
  553.         $this->city ucwords(strtolower($city));
  554.         return $this;
  555.     }
  556.     public function getState(): ?string
  557.     {
  558.         return $this->state;
  559.     }
  560.     public function setState(string $state ""): self
  561.     {
  562.         if (is_null($state)) {
  563.             $state "";
  564.         }
  565.         
  566.         $this->state $state;
  567.         return $this;
  568.     }
  569.     public static function getListOfStates() {
  570.         return SELF::LIST_OF_STATES;
  571.     }
  572.     public function getZip(): ?string
  573.     {
  574.         return $this->zip;
  575.     }
  576.     public function setZip(string $zip null): self
  577.     {
  578.         if (is_null($zip)) {
  579.             $zip "";
  580.         }
  581.         
  582.         $this->zip $zip;
  583.         return $this;
  584.     }
  585.     public function getLast4(): ?string
  586.     {
  587.         return $this->last4;
  588.     }
  589.     public function setLast4(string $last4 null): self
  590.     {
  591.         if (is_null($last4)) {
  592.             $last4 "";
  593.         }
  594.         
  595.         $this->last4 $last4;
  596.         return $this;
  597.     }
  598.     public function getCountry(): ?string
  599.     {
  600.         return $this->country;
  601.     }
  602.     public function setCountry(string $country null): self
  603.     {
  604.         if (is_null($country)) {
  605.             $country "";
  606.         }
  607.         
  608.         $this->country $country;
  609.         return $this;
  610.     }
  611.     
  612.     public function getHomeAddress1(): ?string
  613.     {
  614.         return $this->home_address1;
  615.     }
  616.     public function setHomeAddress1(string $home_address1 null): self
  617.     {
  618.         if (is_null($home_address1)) {
  619.             $home_address1 "";
  620.         }
  621.         
  622.         $this->home_address1 ucwords(strtolower($home_address1));
  623.         return $this;
  624.     }
  625.     
  626.     public function getHomeAddress2(): ?string
  627.     {
  628.         return $this->home_address2;
  629.     }
  630.     public function setHomeAddress2(string $home_address2 null): self
  631.     {
  632.         if (is_null($home_address2)) {
  633.             $home_address2 "";
  634.         }
  635.         
  636.         $this->home_address2 ucwords(strtolower($home_address2));
  637.         
  638.         return $this;
  639.     }
  640.     public function getHomeCity(): ?string
  641.     {
  642.         return $this->home_city;
  643.     }
  644.     public function setHomeCity(string $home_city null): self
  645.     {
  646.         if (is_null($home_city)) {
  647.             $home_city "";
  648.         }
  649.         
  650.         $this->home_city ucwords(strtolower($home_city));
  651.         
  652.         return $this;
  653.     }
  654.     public function getHomeState(): ?string
  655.     {
  656.         return $this->home_state;
  657.     }
  658.     public function setHomeState(string $home_state ""): self
  659.     {
  660.         if (is_null($home_state)) {
  661.             $home_state "";
  662.         }
  663.         
  664.         $this->home_state $home_state;
  665.         
  666.         return $this;
  667.     }
  668.     public function getHomeZip(): ?string
  669.     {
  670.         return $this->home_zip;
  671.     }
  672.     public function setHomeZip(string $home_zip null): self
  673.     {
  674.         if (is_null($home_zip)) {
  675.             $home_zip "";
  676.         }
  677.         
  678.         $this->home_zip $home_zip;
  679.         
  680.         return $this;
  681.     }
  682.     
  683.     public function getHomeCountry(): ?string
  684.     {
  685.         return $this->home_country;
  686.     }
  687.     public function setHomeCountry(string $home_country null): self
  688.     {
  689.         if (is_null($home_country)) {
  690.             $home_country "";
  691.         }
  692.         
  693.         $this->home_country $home_country;
  694.         
  695.         return $this;
  696.     }
  697.     public function getWebsite(): ?string
  698.     {
  699.         return $this->website;
  700.     }
  701.     public function setWebsite(string $website null): self
  702.     {
  703.         if (is_null($website)) {
  704.             $website "";
  705.         }
  706.         
  707.         $this->website $website;
  708.         
  709.         return $this;
  710.     }
  711.     
  712.     public function getBirthday(): ?\DateTimeInterface
  713.     {
  714.         return $this->birthday;
  715.     }
  716.     public function setBirthday(\DateTimeInterface $birthday null): self
  717.     {
  718.         $this->birthday $birthday;
  719.         
  720.         return $this;
  721.     }
  722.     public function getTypeBusiness(): ?string
  723.     {
  724.         return $this->type_business;
  725.     }
  726.     public function setTypeBusiness(string $type_business ""): self
  727.     {
  728.         if (is_null($type_business)) {
  729.             $type_business "";
  730.         }
  731.         
  732.         $this->type_business $type_business;
  733.         
  734.         return $this;
  735.     }
  736.     
  737.     public function typeBusinessContains($type)
  738.     {
  739.         $arr explode(","$this->type_business);
  740.         return in_array($type$arr);
  741.     }
  742.     
  743.     public function getTypeWork(): ?string
  744.     {
  745.         return $this->type_work;
  746.     }
  747.     public function setTypeWork(string $type_work null): self
  748.     {
  749.         if (is_null($type_work)) {
  750.             $type_work "";
  751.         }
  752.         
  753.         $this->type_work $type_work;
  754.         
  755.         return $this;
  756.     }
  757.     public function getYearEstablished(): ?\DateTimeInterface
  758.     {
  759.         return $this->year_established;
  760.     }
  761.     public function setYearEstablished(\DateTimeInterface $year_established null): self
  762.     {
  763.         if (is_null($year_established)) {
  764.             $year_established = new \DateTime("now");
  765.         }
  766.         
  767.         $this->year_established $year_established;
  768.         
  769.         return $this;
  770.     }
  771.     public function getEmployeeSize(): ?int
  772.     {
  773.         return $this->employee_size;
  774.     }
  775.     public function setEmployeeSize(int $employee_size null): self
  776.     {
  777.         if (is_null($employee_size)) {
  778.             $employee_size 0;
  779.         }
  780.         
  781.         $this->employee_size $employee_size;
  782.         
  783.         return $this;
  784.     }
  785.     public function getGender(): ?string
  786.     {
  787.         return $this->gender;
  788.     }
  789.     public function setGender(string $gender null): self
  790.     {
  791.         if (is_null($gender)) {
  792.             $gender "";
  793.         }
  794.         
  795.         $this->gender $gender;
  796.         
  797.         return $this;
  798.     }
  799.     public function getEthnicity(): ?string
  800.     {
  801.         return $this->ethnicity;
  802.     }
  803.     public function setEthnicity(string $ethnicity null): self
  804.     {
  805.         if (is_null($ethnicity)) {
  806.             $ethnicity "";
  807.         }
  808.         
  809.         $this->ethnicity $ethnicity;
  810.         return $this;
  811.     }
  812.     
  813.     public function getLanguage(): ?string
  814.     {
  815.         return $this->language;
  816.     }
  817.     public function setLanguage(string $language null): self
  818.     {
  819.         if (is_null($language)) {
  820.             $language "";
  821.         }
  822.         
  823.         $this->language $language;
  824.         return $this;
  825.     }
  826.     
  827.     public function getPreferredLanguage(): string
  828.     {
  829.         return $this->preferred_language;
  830.     }
  831.     public function setPreferredLanguage(string $preferred_language null): self
  832.     {
  833.         if (is_null($preferred_language)) {
  834.             $preferred_language "";
  835.         }
  836.         
  837.         $this->preferred_language $preferred_language;
  838.         return $this;
  839.     }
  840.     
  841.     public function getSalesVolume()
  842.     {
  843.         return $this->sales_volume;
  844.     }
  845.     public function setSalesVolume($sales_volume null): self
  846.     {
  847.         if (is_null($sales_volume)) {
  848.             $sales_volume 0;
  849.         }
  850.         
  851.         $this->sales_volume $sales_volume;
  852.         return $this;
  853.     }
  854.     
  855.     public function getContractorSpecialty(): ?string
  856.     {
  857.         return $this->contractor_specialty;
  858.     }
  859.     public function setContractorSpecialty(string $contractor_specialty null): self
  860.     {
  861.         if (is_null($contractor_specialty)) {
  862.             $contractor_specialty "";
  863.         }
  864.         
  865.         $this->contractor_specialty $contractor_specialty;
  866.         return $this;
  867.     }
  868.     
  869.     public function getProductsServicesSpecialty(): ?string
  870.     {
  871.         return $this->products_services_specialty;
  872.     }
  873.     public function setProductsServicesSpecialty(string $products_services_specialty null): self
  874.     {
  875.         if (is_null($products_services_specialty)) {
  876.             $products_services_specialty "";
  877.         }
  878.         
  879.         $this->products_services_specialty $products_services_specialty;
  880.         return $this;
  881.     }
  882.     public function getCreatedAt(): ?\DateTimeInterface
  883.     {
  884.         return $this->created_at;
  885.     }
  886.     public function setCreatedAt(\DateTimeInterface $created_at null): self
  887.     {
  888.         if (is_null($created_at)) {
  889.             $created_at = new \DateTime("now");
  890.         }
  891.         
  892.         $this->created_at $created_at;
  893.         return $this;
  894.     }
  895.     
  896.     /**
  897.      * @return Collection|Lead[]
  898.      */
  899.     public function getLeads(): Collection
  900.     {
  901.         return $this->leads;
  902.     }
  903.     public function addLead(Lead $lead): self
  904.     {
  905.         if (!$this->leads->contains($lead)) {
  906.             $this->leads[] = $lead;
  907.             $lead->setContact($this);
  908.         }
  909.         
  910.         return $this;
  911.     }
  912.     public function removeLead(Lead $lead): self
  913.     {
  914.         if ($this->leads->contains($lead)) {
  915.             $this->leads->removeElement($lead);
  916.             // set the owning side to null (unless already changed)
  917.             if ($lead->setContact() === $this) {
  918.                 $lead->setContact(null);
  919.             }
  920.         }
  921.         return $this;
  922.     }
  923.     
  924.     /**
  925.      * @return Collection|User[]
  926.      */
  927.     public function getUsers(): Collection
  928.     {
  929.         return $this->users;
  930.     }
  931.     public function addUser(User $user): self
  932.     {
  933.         if (!$this->users->contains($user)) {
  934.             $this->users[] = $user;
  935.             $user->setContact($this);
  936.         }
  937.         
  938.         return $this;
  939.     }
  940.     
  941.     public function removeUser(User $user): self
  942.     {
  943.         if ($this->users->contains($user)) {
  944.             $this->users->removeElement($user);
  945.             // set the owning side to null (unless already changed)
  946.             if ($user->setContact() === $this) {
  947.                 $user->setContact(null);
  948.             }
  949.         }
  950.         
  951.         return $this;
  952.     }
  953.     
  954.     public function getDoNotEmail(): ?bool
  955.     {
  956.         return $this->do_not_email == 1;
  957.     }
  958.     
  959.     public function setDoNotEmail(bool $do_not_email): self
  960.     {
  961.         $this->do_not_email $do_not_email 0;
  962.         return $this;
  963.     }
  964.     
  965.     public function getRclubInterest(): ?bool
  966.     {
  967.         return $this->rclub_interest == 1;
  968.     }
  969.     
  970.     public function setRclubInterest(bool $rclub_interest): self
  971.     {
  972.         $this->rclub_interest $rclub_interest 0;
  973.         return $this;
  974.     }
  975.     
  976.     public function getStatus(): ?int
  977.     {
  978.         return $this->status;
  979.     }
  980.     
  981.     public function setStatus(int $status): self
  982.     {
  983.         $this->status $status;
  984.         
  985.         return $this;
  986.     }
  987.     
  988.     public function getProspect(): string
  989.     {
  990.         return $this->prospect;
  991.     }
  992.     public function setProspect(string $prospect null): self
  993.     {
  994.         if (is_null($prospect)) {
  995.             $prospect "";
  996.         }
  997.         
  998.         $this->prospect $prospect;
  999.         
  1000.         return $this;
  1001.     }
  1002.     
  1003.     public function getRoofingMaterials(): ?string
  1004.     {
  1005.         return $this->roofing_materials;
  1006.     }
  1007.     public function setRoofingMaterials(string $roofing_materials ""): self
  1008.     {
  1009.         if (is_null($roofing_materials)) {
  1010.             $roofing_materials "";
  1011.         }
  1012.         
  1013.         $this->roofing_materials $roofing_materials;
  1014.         
  1015.         return $this;
  1016.     }
  1017.     
  1018.     public function roofingMaterialsContains($material)
  1019.     {
  1020.         $arr explode(","$this->roofing_materials);
  1021.         return in_array($material$arr);
  1022.     }
  1023.     
  1024.     public function getCreationInfo(): string
  1025.     {
  1026.         return $this->creation_info;
  1027.     }
  1028.     
  1029.     public function setCreationInfo(string $creation_info null): self
  1030.     {
  1031.         $this->creation_info $creation_info $creation_info "";
  1032.         return $this;
  1033.     }
  1034.     
  1035.     public function getContactNotes()
  1036.     {
  1037.         return $this->contactNotes;
  1038.     }
  1039.     public function getContactNotesText()
  1040.     {
  1041.         $notes $this->contactNotes;
  1042.         $return = [];
  1043.         foreach($notes as $note) {
  1044.             $return[] = "\"" $note->getDescription() . "\" " $note->getByLine();
  1045.         }
  1046.         return implode(" - "$return);
  1047.     }
  1048.     
  1049.     public function addContactNote(ContactNote $contactNote): self
  1050.     {
  1051.         if (!$this->contactNotes->contains($contactNote)) {
  1052.             $this->contactNotes[] = $contactNote;
  1053.             $contactNote->setContact($this);
  1054.         }
  1055.         return $this;
  1056.     }
  1057.     public function removeContactNote(ContactNote $contactNote): self
  1058.     {
  1059.         if ($this->contactNotes->contains($contactNote)) {
  1060.             $this->contactNotes->removeElement($contactNote);
  1061.             // set the owning side to null (unless already changed)
  1062.             if ($contactNote->getContact() === $this) {
  1063.                 $contactNote->getContact(null);
  1064.             }
  1065.         }
  1066.         return $this;
  1067.     }
  1068.     
  1069.     public function __toString ()
  1070.     {
  1071.         if($this->firstname) {
  1072.             $return $this->firstname;
  1073.             if($this->lastname)
  1074.             {
  1075.                 $return .= " " $this->lastname;
  1076.             }
  1077.             return $return;
  1078.         }
  1079.         return $this->email $this->email '';
  1080.     }
  1081. }