src/Entity/Headquarter.php line 17

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Entity\Traits\DefaultTrait;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\Persistence\Event\LifecycleEventArgs;
  7. use Doctrine\ORM\Mapping as ORM;
  8. use Symfony\Component\String\ByteString;
  9. /**
  10.  * @ORM\HasLifecycleCallbacks()
  11.  * @ORM\Entity(repositoryClass="App\Repository\HeadquarterRepository")
  12.  */
  13. class Headquarter
  14. {
  15.     use DefaultTrait;
  16.     public const STATUS_UNPUBLISHED 0;
  17.     public const STATUS_PUBLISHED 1;
  18.     public const STATUS = [
  19.         'UNPUBLISHED' => self::STATUS_UNPUBLISHED,
  20.         'PUBLISHED' => self::STATUS_PUBLISHED
  21.     ];
  22.     /**
  23.      * @ORM\Id()
  24.      * @ORM\GeneratedValue()
  25.      * @ORM\Column(type="integer")
  26.      */
  27.     private int $id;
  28.     /**
  29.      * @var HeadquarterConfig
  30.      *
  31.      * @ORM\OneToOne(targetEntity="App\Entity\HeadquarterConfig", cascade={"persist", "remove"})
  32.      */
  33.     private $config;
  34.     /**
  35.      * @ORM\ManyToOne(targetEntity="App\Entity\Language")
  36.      * @ORM\JoinColumn(nullable=false)
  37.      */
  38.     private Language $preferred_language;
  39.     /**
  40.      * @ORM\Column(type="string", length=128, unique=true)
  41.      */
  42.     private string $alias;
  43.     /**
  44.      * @ORM\Column(type="string", length=50, unique=true)
  45.      */
  46.     private string $api_key;
  47.     /**
  48.      * @ORM\Column(type="string", length=128)
  49.      */
  50.     private string $name;
  51.     /**
  52.      * @ORM\Column(type="string", length=255, nullable=true)
  53.      */
  54.     private ?string $cif null;
  55.     /**
  56.      * @ORM\Column(type="string", length=255, nullable=true)
  57.      */
  58.     private ?string $logo null;
  59.     /**
  60.      * @ORM\Column(type="string", length=128, nullable=true)
  61.      */
  62.     private ?string $email null;
  63.     /**
  64.      * @ORM\Column(type="string", length=128, nullable=true)
  65.      */
  66.     private ?string $phone null;
  67.     /**
  68.      * @ORM\Column(type="string", length=255, nullable=true)
  69.      */
  70.     private ?string $address null;
  71.     /**
  72.      * @ORM\Column(type="string", length=255, nullable=true)
  73.      */
  74.     private ?string $city null;
  75.     /**
  76.      * @ORM\Column(type="string", length=255, nullable=true)
  77.      */
  78.     private ?string $postal null;
  79.     /**
  80.      * @ORM\Column(type="string", length=255, nullable=true)
  81.      */
  82.     private ?string $region null;
  83.     /**
  84.      * @ORM\Column(type="string", length=255, nullable=true)
  85.      */
  86.     private ?string $country null;
  87.     /**
  88.      * @ORM\Column(type="string", length=255, nullable=true)
  89.      */
  90.     private ?string $config_mailer_transport null;
  91.     /**
  92.      * @ORM\Column(type="boolean")
  93.      */
  94.     private bool $is_generic false;
  95.     /**
  96.      * @var ArrayCollection|Role[]
  97.      *
  98.      * @ORM\OneToMany(targetEntity="App\Entity\Role", mappedBy="headquarter")
  99.      */
  100.     private $roles;
  101.     /**
  102.      * @var ArrayCollection|Permission[]
  103.      *
  104.      * @ORM\ManyToMany(targetEntity="App\Entity\Permission", inversedBy="headquarters")
  105.      * @ORM\JoinTable(name="headquarter_permission")
  106.      * @ORM\OrderBy({"alias" = "ASC"})
  107.      */
  108.     private $permissions;
  109.     /**
  110.      * @var ArrayCollection|Admin[]
  111.      *
  112.      * @ORM\OneToMany(targetEntity="App\Entity\Admin", mappedBy="headquarter")
  113.      */
  114.     private $admins;
  115.     /**
  116.      * @var ArrayCollection|Audience[]
  117.      *
  118.      * @ORM\OneToMany(targetEntity="App\Entity\Audience", mappedBy="headquarter")
  119.      */
  120.     private $audiences;
  121.     /**
  122.      * @var ArrayCollection|Article[]
  123.      *
  124.      * @ORM\OneToMany(targetEntity="App\Entity\Article", mappedBy="headquarter")
  125.      */
  126.     private $articles;
  127.     /**
  128.      * @var ArrayCollection|Email[]
  129.      *
  130.      * @ORM\OneToMany(targetEntity="App\Entity\Email", mappedBy="headquarter")
  131.      */
  132.     private $emails;
  133.     /**
  134.      * @var ArrayCollection|Notification[]
  135.      *
  136.      * @ORM\OneToMany(targetEntity="App\Entity\Notification", mappedBy="headquarter")
  137.      */
  138.     private $notifications;
  139.     /**
  140.      * @var ArrayCollection|Reservation[]
  141.      *
  142.      * @ORM\OneToMany(targetEntity="App\Entity\Reservation", mappedBy="headquarter")
  143.      */
  144.     private $reservations;
  145.     /**
  146.      * @var ArrayCollection|Survey[]
  147.      *
  148.      * @ORM\OneToMany(targetEntity="App\Entity\Survey", mappedBy="headquarter")
  149.      */
  150.     private $surveys;
  151.     /**
  152.      * @var ArrayCollection|Workgroup[]
  153.      *
  154.      * @ORM\OneToMany(targetEntity="App\Entity\Workgroup", mappedBy="headquarter")
  155.      */
  156.     private $workgroups;
  157.     /**
  158.      * @var ArrayCollection|Category[]
  159.      *
  160.      * @ORM\OneToMany(targetEntity="App\Entity\Category", mappedBy="headquarter")
  161.      * @ORM\OrderBy({"lft" = "ASC"})
  162.      */
  163.     private $categories;
  164.     /**
  165.      * @var ArrayCollection|Tag[]
  166.      *
  167.      * @ORM\OneToMany(targetEntity="App\Entity\Tag", mappedBy="headquarter")
  168.      */
  169.     private $tags;
  170.     /**
  171.      * @ORM\OneToMany(targetEntity="App\Entity\HeadquarterHomeRow", mappedBy="headquarter")
  172.      */
  173.     private $headquarterHomeRows;
  174.     /**
  175.      * @ORM\OneToMany(targetEntity="App\Entity\HeadquarterHomeWidget", mappedBy="headquarter")
  176.      */
  177.     private $headquarterHomeWidgets;
  178.     /**
  179.      * @var ArrayCollection|TagGroup[]
  180.      *
  181.      * @ORM\OneToMany(targetEntity="App\Entity\TagGroup", mappedBy="headquarter")
  182.      */
  183.     private $tag_groups;
  184.     /**
  185.      * @var ArrayCollection|User[]
  186.      *
  187.      * @ORM\OneToMany(targetEntity="App\Entity\User", mappedBy="headquarter")
  188.      * @ORM\OrderBy({"cdate" = "DESC"})
  189.      */
  190.     private $users;
  191.     /**
  192.      * @var ArrayCollection|Language[]
  193.      *
  194.      * @ORM\ManyToMany(targetEntity="App\Entity\Language", inversedBy="headquarters")
  195.      * @ORM\JoinTable(name="headquarter_language")
  196.      */
  197.     private $languages;
  198.     /**
  199.      * @var ArrayCollection|Workplace[]
  200.      *
  201.      * @ORM\OneToMany(targetEntity=Workplace::class, mappedBy="headquarter")
  202.      */
  203.     private $workplaces;
  204.     /**
  205.      * @var array
  206.      * @ORM\Column(type="json")
  207.      */
  208.     private $app_config = [
  209.         'hasQrCode' => true,
  210.         'slotQuizz' => 1,// week
  211.         'adminTimesheetShowAll' => false
  212.     ];
  213.     /**
  214.      * @var ArrayCollection|Link[]
  215.      *
  216.      * @ORM\OneToMany(targetEntity="App\Entity\Link", mappedBy="headquarter")
  217.      */
  218.     private $links;
  219.     /**
  220.      * @ORM\Column(type="boolean")
  221.      */
  222.     private bool $is_enabled_holiday_remember true;
  223.     /**
  224.      * @ORM\Column(type="string", length=255, nullable=true)
  225.      */
  226.     private string $web_domain;
  227.     /**
  228.      * @var array
  229.      * @ORM\Column(type="json")
  230.      */
  231.     private $web_config = [
  232.         'logo' => null,
  233.         'authenticatedLogo' => null,
  234.         'color' => null,
  235.         'backgroundImage' => null,
  236.         'favicon' => null,
  237.         'fingerprintEnabled' => false
  238.     ];
  239.     /**
  240.      * @ORM\Column(type="text", nullable=true)
  241.      */
  242.     private $android_url;
  243.     /**
  244.      * @ORM\Column(type="text", nullable=true)
  245.      */
  246.     private $ios_url;
  247.     /**
  248.      * @ORM\Column(type="string", length=512, unique=true, nullable=true)
  249.      */
  250.     private $external_api_key;
  251.     /**
  252.      * @ORM\Column(type="json", nullable=true)
  253.      */
  254.     private $external_api_config = [];
  255.     /**
  256.      * @ORM\Column(type="string", length=255, nullable=true)
  257.      */
  258.     private $config_mailer_from;
  259.     /**
  260.      * @ORM\JoinColumn(onDelete="SET NULL")
  261.      * @ORM\ManyToOne(targetEntity=User::class)
  262.      */
  263.     private $holidays_bcc_user;
  264.     /**
  265.      * @ORM\Column(type="string", length=255, nullable=true)
  266.      */
  267.     private $firebase_name_database;
  268.     /**
  269.      * @ORM\Column(type="json")
  270.      */
  271.     private $firebase_service_account = [];
  272.     /**
  273.      * @ORM\Column(type="boolean", nullable=true)
  274.      */
  275.     private $register_available;
  276.     public function __construct()
  277.     {
  278.         $this->roles = new ArrayCollection();
  279.         $this->permissions = new ArrayCollection();
  280.         $this->admins = new ArrayCollection();
  281.         $this->audiences = new ArrayCollection();
  282.         $this->articles = new ArrayCollection();
  283.         $this->emails = new ArrayCollection();
  284.         $this->notifications = new ArrayCollection();
  285.         $this->surveys = new ArrayCollection();
  286.         $this->workgroups = new ArrayCollection();
  287.         $this->categories = new ArrayCollection();
  288.         $this->tags = new ArrayCollection();
  289.         $this->tag_groups = new ArrayCollection();
  290.         $this->users = new ArrayCollection();
  291.         $this->languages = new ArrayCollection();
  292.         $this->reservations = new ArrayCollection();
  293.         $this->workplaces = new ArrayCollection();
  294.         $this->links = new ArrayCollection();
  295.     }
  296.     /**
  297.      * @internal Added function
  298.      */
  299.     public function getLanguagesAlternates(): Collection
  300.     {
  301.         $preferred $this->preferred_language;
  302.         return $this->languages->filter(function ($el) use ($preferred) {
  303.             return $el !== $preferred;
  304.         });
  305.     }
  306.     /**
  307.      * @internal Added function
  308.      */
  309.     public function getPermissionsToArray(): array
  310.     {
  311.         return $this->permissions->map(function ($el) {
  312.             return $el->getAlias();
  313.         })->toArray();
  314.     }
  315.     public function getId(): ?int
  316.     {
  317.         return $this->id;
  318.     }
  319.     public function getConfig(): HeadquarterConfig
  320.     {
  321.         return $this->config;
  322.     }
  323.     public function setConfig(?HeadquarterConfig $config): self
  324.     {
  325.         $this->config $config;
  326.         return $this;
  327.     }
  328.     public function getAlias(): ?string
  329.     {
  330.         return $this->alias;
  331.     }
  332.     public function setAlias(string $alias): self
  333.     {
  334.         $this->alias $alias;
  335.         return $this;
  336.     }
  337.     public function getApiKey(): ?string
  338.     {
  339.         return $this->api_key;
  340.     }
  341.     public function setApiKey(string $api_key): self
  342.     {
  343.         $this->api_key $api_key;
  344.         return $this;
  345.     }
  346.     public function getName(): ?string
  347.     {
  348.         return $this->name;
  349.     }
  350.     public function setName(string $name): self
  351.     {
  352.         $this->name $name;
  353.         return $this;
  354.     }
  355.     public function getCif(): ?string
  356.     {
  357.         return $this->cif;
  358.     }
  359.     public function setCif(?string $cif): self
  360.     {
  361.         $this->cif $cif;
  362.         return $this;
  363.     }
  364.     public function getLogo(): ?string
  365.     {
  366.         return $this->logo;
  367.     }
  368.     public function setLogo(?string $logo): self
  369.     {
  370.         $this->logo $logo;
  371.         return $this;
  372.     }
  373.     public function getEmail(): ?string
  374.     {
  375.         return $this->email;
  376.     }
  377.     public function setEmail(?string $email): self
  378.     {
  379.         $this->email $email;
  380.         return $this;
  381.     }
  382.     public function getPhone(): ?string
  383.     {
  384.         return $this->phone;
  385.     }
  386.     public function setPhone(?string $phone): self
  387.     {
  388.         $this->phone $phone;
  389.         return $this;
  390.     }
  391.     public function getAddress(): ?string
  392.     {
  393.         return $this->address;
  394.     }
  395.     public function setAddress(?string $address): self
  396.     {
  397.         $this->address $address;
  398.         return $this;
  399.     }
  400.     public function getCity(): ?string
  401.     {
  402.         return $this->city;
  403.     }
  404.     public function setCity(?string $city): self
  405.     {
  406.         $this->city $city;
  407.         return $this;
  408.     }
  409.     public function getPostal(): ?string
  410.     {
  411.         return $this->postal;
  412.     }
  413.     public function setPostal(?string $postal): self
  414.     {
  415.         $this->postal $postal;
  416.         return $this;
  417.     }
  418.     public function getRegion(): ?string
  419.     {
  420.         return $this->region;
  421.     }
  422.     public function setRegion(?string $region): self
  423.     {
  424.         $this->region $region;
  425.         return $this;
  426.     }
  427.     public function getCountry(): ?string
  428.     {
  429.         return $this->country;
  430.     }
  431.     public function setCountry(?string $country): self
  432.     {
  433.         $this->country $country;
  434.         return $this;
  435.     }
  436.     public function getConfigMailerTransport(): ?string
  437.     {
  438.         return $this->config_mailer_transport;
  439.     }
  440.     public function setConfigMailerTransport(?string $config_mailer_transport): self
  441.     {
  442.         $this->config_mailer_transport $config_mailer_transport;
  443.         return $this;
  444.     }
  445.     public function getPreferredLanguage(): ?Language
  446.     {
  447.         return $this->preferred_language;
  448.     }
  449.     public function setPreferredLanguage(?Language $preferred_language): self
  450.     {
  451.         $this->preferred_language $preferred_language;
  452.         return $this;
  453.     }
  454.     /**
  455.      * @return Collection|Role[]
  456.      */
  457.     public function getRoles(): Collection
  458.     {
  459.         return $this->roles;
  460.     }
  461.     public function addRole(Role $role): self
  462.     {
  463.         if (!$this->roles->contains($role)) {
  464.             $this->roles[] = $role;
  465.             $role->setHeadquarter($this);
  466.         }
  467.         return $this;
  468.     }
  469.     public function removeRole(Role $role): self
  470.     {
  471.         if ($this->roles->removeElement($role)) {
  472.             // set the owning side to null (unless already changed)
  473.             if ($role->getHeadquarter() === $this) {
  474.                 $role->setHeadquarter(null);
  475.             }
  476.         }
  477.         return $this;
  478.     }
  479.     /**
  480.      * @return Collection|Permission[]
  481.      */
  482.     public function getPermissions(): Collection
  483.     {
  484.         return $this->permissions;
  485.     }
  486.     public function addPermission(Permission $permission): self
  487.     {
  488.         if (!$this->permissions->contains($permission)) {
  489.             $this->permissions[] = $permission;
  490.         }
  491.         return $this;
  492.     }
  493.     public function removePermission(Permission $permission): self
  494.     {
  495.         $this->permissions->removeElement($permission);
  496.         return $this;
  497.     }
  498.     /**
  499.      * @return Collection|Admin[]
  500.      */
  501.     public function getAdmins(): Collection
  502.     {
  503.         return $this->admins;
  504.     }
  505.     public function addAdmin(Admin $admin): self
  506.     {
  507.         if (!$this->admins->contains($admin)) {
  508.             $this->admins[] = $admin;
  509.             $admin->setHeadquarter($this);
  510.         }
  511.         return $this;
  512.     }
  513.     public function removeAdmin(Admin $admin): self
  514.     {
  515.         if ($this->admins->removeElement($admin)) {
  516.             // set the owning side to null (unless already changed)
  517.             if ($admin->getHeadquarter() === $this) {
  518.                 $admin->setHeadquarter(null);
  519.             }
  520.         }
  521.         return $this;
  522.     }
  523.     /**
  524.      * @return Collection|Audience[]
  525.      */
  526.     public function getAudiences(): Collection
  527.     {
  528.         return $this->audiences;
  529.     }
  530.     public function addAudience(Audience $audience): self
  531.     {
  532.         if (!$this->audiences->contains($audience)) {
  533.             $this->audiences[] = $audience;
  534.             $audience->setHeadquarter($this);
  535.         }
  536.         return $this;
  537.     }
  538.     public function removeAudience(Audience $audience): self
  539.     {
  540.         if ($this->audiences->removeElement($audience)) {
  541.             // set the owning side to null (unless already changed)
  542.             if ($audience->getHeadquarter() === $this) {
  543.                 $audience->setHeadquarter(null);
  544.             }
  545.         }
  546.         return $this;
  547.     }
  548.     /**
  549.      * @return Collection|Article[]
  550.      */
  551.     public function getArticles(): Collection
  552.     {
  553.         return $this->articles;
  554.     }
  555.     public function addArticle(Article $article): self
  556.     {
  557.         if (!$this->articles->contains($article)) {
  558.             $this->articles[] = $article;
  559.             $article->setHeadquarter($this);
  560.         }
  561.         return $this;
  562.     }
  563.     public function removeArticle(Article $article): self
  564.     {
  565.         if ($this->articles->removeElement($article)) {
  566.             // set the owning side to null (unless already changed)
  567.             if ($article->getHeadquarter() === $this) {
  568.                 $article->setHeadquarter(null);
  569.             }
  570.         }
  571.         return $this;
  572.     }
  573.     /**
  574.      * @return Collection|Email[]
  575.      */
  576.     public function getEmails(): Collection
  577.     {
  578.         return $this->emails;
  579.     }
  580.     public function addEmail(Email $email): self
  581.     {
  582.         if (!$this->emails->contains($email)) {
  583.             $this->emails[] = $email;
  584.             $email->setHeadquarter($this);
  585.         }
  586.         return $this;
  587.     }
  588.     public function removeEmail(Email $email): self
  589.     {
  590.         if ($this->emails->removeElement($email)) {
  591.             // set the owning side to null (unless already changed)
  592.             if ($email->getHeadquarter() === $this) {
  593.                 $email->setHeadquarter(null);
  594.             }
  595.         }
  596.         return $this;
  597.     }
  598.     /**
  599.      * @return Collection|Notification[]
  600.      */
  601.     public function getNotifications(): Collection
  602.     {
  603.         return $this->notifications;
  604.     }
  605.     public function addNotification(Notification $notification): self
  606.     {
  607.         if (!$this->notifications->contains($notification)) {
  608.             $this->notifications[] = $notification;
  609.             $notification->setHeadquarter($this);
  610.         }
  611.         return $this;
  612.     }
  613.     public function removeNotification(Notification $notification): self
  614.     {
  615.         if ($this->notifications->removeElement($notification)) {
  616.             // set the owning side to null (unless already changed)
  617.             if ($notification->getHeadquarter() === $this) {
  618.                 $notification->setHeadquarter(null);
  619.             }
  620.         }
  621.         return $this;
  622.     }
  623.     /**
  624.      * @return Collection|Reservation[]
  625.      */
  626.     public function getReservations(): Collection
  627.     {
  628.         return $this->reservations;
  629.     }
  630.     public function addReservation(Reservation $reservation): self
  631.     {
  632.         if (!$this->reservations->contains($reservation)) {
  633.             $this->reservations[] = $reservation;
  634.             $reservation->setHeadquarter($this);
  635.         }
  636.         return $this;
  637.     }
  638.     public function removeReservation(Reservation $reservation): self
  639.     {
  640.         if ($this->reservations->removeElement($reservation)) {
  641.             // set the owning side to null (unless already changed)
  642.             if ($reservation->getHeadquarter() === $this) {
  643.                 $reservation->setHeadquarter(null);
  644.             }
  645.         }
  646.         return $this;
  647.     }
  648.     /**
  649.      * @return Collection|Survey[]
  650.      */
  651.     public function getSurveys(): Collection
  652.     {
  653.         return $this->surveys;
  654.     }
  655.     public function addSurvey(Survey $survey): self
  656.     {
  657.         if (!$this->surveys->contains($survey)) {
  658.             $this->surveys[] = $survey;
  659.             $survey->setHeadquarter($this);
  660.         }
  661.         return $this;
  662.     }
  663.     public function removeSurvey(Survey $survey): self
  664.     {
  665.         if ($this->surveys->removeElement($survey)) {
  666.             // set the owning side to null (unless already changed)
  667.             if ($survey->getHeadquarter() === $this) {
  668.                 $survey->setHeadquarter(null);
  669.             }
  670.         }
  671.         return $this;
  672.     }
  673.     /**
  674.      * @return Collection|Workgroup[]
  675.      */
  676.     public function getWorkgroups(): Collection
  677.     {
  678.         return $this->workgroups;
  679.     }
  680.     public function addWorkgroup(Workgroup $workgroup): self
  681.     {
  682.         if (!$this->workgroups->contains($workgroup)) {
  683.             $this->workgroups[] = $workgroup;
  684.             $workgroup->setHeadquarter($this);
  685.         }
  686.         return $this;
  687.     }
  688.     public function removeWorkgroup(Workgroup $workgroup): self
  689.     {
  690.         if ($this->workgroups->removeElement($workgroup)) {
  691.             // set the owning side to null (unless already changed)
  692.             if ($workgroup->getHeadquarter() === $this) {
  693.                 $workgroup->setHeadquarter(null);
  694.             }
  695.         }
  696.         return $this;
  697.     }
  698.     /**
  699.      * @return Collection|Category[]
  700.      */
  701.     public function getCategories(): Collection
  702.     {
  703.         return $this->categories;
  704.     }
  705.     public function addCategory(Category $category): self
  706.     {
  707.         if (!$this->categories->contains($category)) {
  708.             $this->categories[] = $category;
  709.             $category->setHeadquarter($this);
  710.         }
  711.         return $this;
  712.     }
  713.     public function removeCategory(Category $category): self
  714.     {
  715.         if ($this->categories->removeElement($category)) {
  716.             // set the owning side to null (unless already changed)
  717.             if ($category->getHeadquarter() === $this) {
  718.                 $category->setHeadquarter(null);
  719.             }
  720.         }
  721.         return $this;
  722.     }
  723.     /**
  724.      * @return Collection|Tag[]
  725.      */
  726.     public function getTags(): Collection
  727.     {
  728.         return $this->tags;
  729.     }
  730.     public function addTag(Tag $tag): self
  731.     {
  732.         if (!$this->tags->contains($tag)) {
  733.             $this->tags[] = $tag;
  734.             $tag->setHeadquarter($this);
  735.         }
  736.         return $this;
  737.     }
  738.     public function removeTag(Tag $tag): self
  739.     {
  740.         if ($this->tags->removeElement($tag)) {
  741.             // set the owning side to null (unless already changed)
  742.             if ($tag->getHeadquarter() === $this) {
  743.                 $tag->setHeadquarter(null);
  744.             }
  745.         }
  746.         return $this;
  747.     }
  748.     /**
  749.      * @return Collection|TagGroup[]
  750.      */
  751.     public function getTagGroups(): Collection
  752.     {
  753.         return $this->tag_groups;
  754.     }
  755.     public function addTagGroup(TagGroup $tagGroup): self
  756.     {
  757.         if (!$this->tag_groups->contains($tagGroup)) {
  758.             $this->tag_groups[] = $tagGroup;
  759.             $tagGroup->setHeadquarter($this);
  760.         }
  761.         return $this;
  762.     }
  763.     public function removeTagGroup(TagGroup $tagGroup): self
  764.     {
  765.         if ($this->tag_groups->removeElement($tagGroup)) {
  766.             // set the owning side to null (unless already changed)
  767.             if ($tagGroup->getHeadquarter() === $this) {
  768.                 $tagGroup->setHeadquarter(null);
  769.             }
  770.         }
  771.         return $this;
  772.     }
  773.     /**
  774.      * @return Collection|User[]
  775.      */
  776.     public function getUsers(): Collection
  777.     {
  778.         return $this->users;
  779.     }
  780.     public function addUser(User $user): self
  781.     {
  782.         if (!$this->users->contains($user)) {
  783.             $this->users[] = $user;
  784.             $user->setHeadquarter($this);
  785.         }
  786.         return $this;
  787.     }
  788.     public function removeUser(User $user): self
  789.     {
  790.         if ($this->users->removeElement($user)) {
  791.             // set the owning side to null (unless already changed)
  792.             if ($user->getHeadquarter() === $this) {
  793.                 $user->setHeadquarter(null);
  794.             }
  795.         }
  796.         return $this;
  797.     }
  798.     public function clearLanguages(): void
  799.     {
  800.         $this->languages->clear();
  801.     }
  802.     public function clearPermissions(): void
  803.     {
  804.         $this->permissions->clear();
  805.     }
  806.     /**
  807.      * @return Collection|Language[]
  808.      */
  809.     public function getLanguages(): Collection
  810.     {
  811.         return $this->languages;
  812.     }
  813.     public function addLanguage(Language $language): self
  814.     {
  815.         if (!$this->languages->contains($language)) {
  816.             $this->languages[] = $language;
  817.         }
  818.         return $this;
  819.     }
  820.     public function removeLanguage(Language $language): self
  821.     {
  822.         $this->languages->removeElement($language);
  823.         return $this;
  824.     }
  825.     /**
  826.      * @return Collection|Workplace[]
  827.      */
  828.     public function getWorkplaces(): Collection
  829.     {
  830.         return $this->workplaces;
  831.     }
  832.     public function addWorkplace(Workplace $workplace): self
  833.     {
  834.         if (!$this->workplaces->contains($workplace)) {
  835.             $this->workplaces[] = $workplace;
  836.             $workplace->setHeadquarter($this);
  837.         }
  838.         return $this;
  839.     }
  840.     public function removeWorkplace(Workplace $workplace): self
  841.     {
  842.         if ($this->workplaces->removeElement($workplace)) {
  843.             // set the owning side to null (unless already changed)
  844.             if ($workplace->getHeadquarter() === $this) {
  845.                 $workplace->setHeadquarter(null);
  846.             }
  847.         }
  848.         return $this;
  849.     }
  850.     public function getAppConfig(): ?array
  851.     {
  852.         return $this->app_config;
  853.     }
  854.     public function setAppConfig(array $app_config): self
  855.     {
  856.         $this->app_config $app_config;
  857.         return $this;
  858.     }
  859.     /**
  860.      * @return Collection|Link[]
  861.      */
  862.     public function getLinks(): Collection
  863.     {
  864.         return $this->links;
  865.     }
  866.     public function addLink(Link $link): self
  867.     {
  868.         if (!$this->links->contains($link)) {
  869.             $this->links[] = $link;
  870.             $link->setHeadquarter($this);
  871.         }
  872.         return $this;
  873.     }
  874.     public function removeLink(Link $link): self
  875.     {
  876.         if ($this->links->removeElement($link)) {
  877.             // set the owning side to null (unless already changed)
  878.             if ($link->getHeadquarter() === $this) {
  879.                 $link->setHeadquarter(null);
  880.             }
  881.         }
  882.         return $this;
  883.     }
  884.     public function getIsGeneric(): ?bool
  885.     {
  886.         return $this->is_generic;
  887.     }
  888.     public function setIsGeneric(bool $is_generic): self
  889.     {
  890.         $this->is_generic $is_generic;
  891.         return $this;
  892.     }
  893.     public function getIsEnabledHolidayRemember(): ?bool
  894.     {
  895.         return $this->is_enabled_holiday_remember;
  896.     }
  897.     public function setIsEnabledHolidayRemember(bool $is_enabled_holiday_remember): self
  898.     {
  899.         $this->is_enabled_holiday_remember $is_enabled_holiday_remember;
  900.         return $this;
  901.     }
  902.     public function getWebDomain(): ?string
  903.     {
  904.         return $this->web_domain;
  905.     }
  906.     public function setWebDomain(?string $web_domain): self
  907.     {
  908.         $this->web_domain $web_domain;
  909.         return $this;
  910.     }
  911.     public function getWebConfig(): ?array
  912.     {
  913.         return $this->web_config;
  914.     }
  915.     public function setWebConfig(array $web_config): self
  916.     {
  917.         $this->web_config $web_config;
  918.         return $this;
  919.     }
  920.     public function getAndroidUrl(): ?string
  921.     {
  922.         return $this->android_url;
  923.     }
  924.     public function setAndroidUrl(?string $android_url): self
  925.     {
  926.         $this->android_url $android_url;
  927.         return $this;
  928.     }
  929.     public function getIosUrl(): ?string
  930.     {
  931.         return $this->ios_url;
  932.     }
  933.     public function setIosUrl(?string $ios_url): self
  934.     {
  935.         $this->ios_url $ios_url;
  936.         return $this;
  937.     }
  938.     public function getExternalApiKey(): ?string
  939.     {
  940.         return $this->external_api_key;
  941.     }
  942.     public function getExternalApiConfig(): ?array
  943.     {
  944.         return $this->external_api_config;
  945.     }
  946.     public function setExternalApiConfig(?array $external_api_config): self
  947.     {
  948.         $this->external_api_config $external_api_config;
  949.         return $this;
  950.     }
  951.     public function getHomeRows(): ?Collection
  952.     {
  953.         return $this->headquarterHomeRows;
  954.     }
  955.     public function getHomeWidgets(): ?Collection
  956.     {
  957.         return $this->headquarterHomeWidgets;
  958.     }
  959.     public function getConfigMailerFrom(): ?string
  960.     {
  961.         return $this->config_mailer_from;
  962.     }
  963.     public function setConfigMailerFrom(?string $config_mailer_from): self
  964.     {
  965.         $this->config_mailer_from $config_mailer_from;
  966.         return $this;
  967.     }
  968.     public function getHolidaysBccUser(): ?User
  969.     {
  970.         return $this->holidays_bcc_user;
  971.     }
  972.     public function setHolidaysBccUser(?User $holidays_bcc_user): self
  973.     {
  974.         $this->holidays_bcc_user $holidays_bcc_user;
  975.         return $this;
  976.     }
  977.     public function getFirebaseNameDatabase(): ?string
  978.     {
  979.         return $this->firebase_name_database;
  980.     }
  981.     public function setFirebaseNameDatabase(?string $firebase_name_database): self
  982.     {
  983.         $this->firebase_name_database $firebase_name_database;
  984.         return $this;
  985.     }
  986.     public function getFirebaseServiceAccount(): ?array
  987.     {
  988.         return $this->firebase_service_account;
  989.     }
  990.     public function setFirebaseServiceAccount(array $firebase_service_account): self
  991.     {
  992.         $this->firebase_service_account $firebase_service_account;
  993.         return $this;
  994.     }
  995.     public function getRegisterAvailable(): ?bool
  996.     {
  997.         return $this->register_available;
  998.     }
  999.     public function setRegisterAvailable(?bool $register_available): self
  1000.     {
  1001.         $this->register_available $register_available;
  1002.         return $this;
  1003.     }
  1004. }