src/Entity/Gos/Category.php line 20

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Gos;
  3. use App\Entity\Gos\Tmpl\Template;
  4. use App\Entity\Gos\Uniqskills\Cooperator;
  5. use App\Entity\Gos\Uniqskills\Author;
  6. use App\Entity\Gos\Uniqskills\Course;
  7. use Doctrine\Common\Collections\Collection;
  8. use Doctrine\ORM\Mapping as ORM;
  9. use Doctrine\Common\Collections\ArrayCollection;
  10. use Vich\UploaderBundle\Mapping\Annotation as Vich;
  11. use Symfony\Component\HttpFoundation\File\File;
  12. /**
  13.  * @ORM\Entity(repositoryClass="App\Repository\CategoriesRepository")
  14.  * @ORM\HasLifecycleCallbacks()
  15.  * @Vich\Uploadable
  16.  */
  17. class Category
  18. {
  19.     /**
  20.      * @ORM\Id()
  21.      * @ORM\GeneratedValue()
  22.      * @ORM\Column(type="integer")
  23.      */
  24.     private $id;
  25.     /**
  26.      * @ORM\Column(type="boolean", nullable=true)
  27.      */
  28.     private $isActive;
  29.     /**
  30.      * @ORM\Column(type="text", nullable=true)
  31.      */
  32.     private $shortBody;
  33.     /**
  34.      * @ORM\Column(type="text", nullable=true)
  35.      */
  36.     private $body;
  37.     /**
  38.      * @ORM\Column(type="text", nullable=true)
  39.      */
  40.     private $testimonialsCustom;
  41.     /**
  42.      * @var ArrayCollection
  43.      *
  44.      * @ORM\ManyToOne(targetEntity="App\Entity\Gos\Category", inversedBy="children")
  45.      * @ORM\JoinColumn(name="parent_id", referencedColumnName="id", onDelete="CASCADE")
  46.      */
  47.     private $parent;
  48.     /**
  49.      * @var Category
  50.      *
  51.      * @ORM\OneToMany(targetEntity="App\Entity\Gos\Category", mappedBy="parent")
  52.      * @ORM\OrderBy({"position" = "ASC"})
  53.      */
  54.     private $children;
  55.     /**
  56.      * @ORM\Column(type="string", length=64)
  57.      */
  58.     private $categoryName;
  59.     /**
  60.      * @ORM\Column(type="string", length=64)
  61.      */
  62.     private $categorySlug;
  63.     /**
  64.      * @ORM\Column(name="position", type="string", length=255, nullable=true)
  65.      */
  66.     private $position;
  67.     /**
  68.      * @ORM\OneToOne(targetEntity="App\Entity\Gos\Tmpl\Template", mappedBy="category", cascade={"persist", "remove"})
  69.      */
  70.     private $template;
  71.     /**
  72.      * @ORM\ManyToOne(targetEntity="App\Entity\Gos\PortalSettings", inversedBy="categories")
  73.      * @ORM\JoinColumn()
  74.      */
  75.     private $portalSettings;
  76.     /**
  77.      * @ORM\OneToOne(targetEntity="App\Entity\Gos\ProductAssociation", inversedBy="recommendedByCategory")
  78.      */
  79.     private $recommendedProductAssociation;
  80.     /**
  81.      * @ORM\OneToMany(targetEntity="App\Entity\Gos\ProductAssociation", mappedBy="categoryMaster")
  82.      */
  83.     private $productAssociationMaster;
  84.     /**
  85.      * @ORM\ManyToMany(targetEntity="App\Entity\Gos\ProductAssociation", mappedBy="categories")
  86.      */
  87.     private $productAssociations;
  88.     /**
  89.      * @ORM\OneToMany(targetEntity="App\Entity\Gos\Uniqskills\Course", mappedBy="category")
  90.      */
  91.     private $courses;
  92.     /**
  93.      * @ORM\ManyToMany(targetEntity="App\Entity\Gos\Uniqskills\Course", mappedBy="additionalCategories")
  94.      */
  95.     private $additionalCourses;
  96.     /**
  97.      * @ORM\ManyToOne(targetEntity="App\Entity\Gos\Language", inversedBy="categories",  fetch="EAGER")
  98.      */
  99.     private $language;
  100.     /**
  101.      * @ORM\OneToOne(targetEntity="App\Entity\Gos\MetaTags", mappedBy="category")
  102.      */
  103.     private $metaTags;
  104.     /**
  105.      * @ORM\ManyToMany(targetEntity="App\Entity\Gos\Uniqskills\Author", mappedBy="categories")
  106.      */
  107.     private $author;
  108.     /**
  109.      * @ORM\ManyToMany(targetEntity="App\Entity\Gos\Uniqskills\Author", mappedBy="categoriesProgramCouncil")
  110.      */
  111.     private $programCouncil;
  112.     /**
  113.      * @ORM\ManyToMany(targetEntity="App\Entity\Gos\Uniqskills\Cooperator", mappedBy="categories")
  114.      * @ORM\JoinTable()
  115.      */
  116.     private $cooperators;
  117.     /**
  118.      * @ORM\OneToMany(targetEntity="StaticPage", mappedBy="category")
  119.      */
  120.     private $staticPages;
  121.     /**
  122.      * NOTE: This is not a mapped field of entity metadata, just a simple property.
  123.      *
  124.      * @Vich\UploadableField(mapping="product_image", fileNameProperty="imageName")
  125.      *
  126.      * @var File
  127.      */
  128.     private $imageFile;
  129.     /**
  130.      * @ORM\Column(type="string", length=255, nullable=true)
  131.      *
  132.      * @var string
  133.      */
  134.     private $imageName;
  135.     /**
  136.      * NOTE: This is not a mapped field of entity metadata, just a simple property.
  137.      * @Vich\UploadableField(mapping="banner_image", fileNameProperty="bannerName")
  138.      * @var File
  139.      */
  140.     private $bannerFile;
  141.     /**
  142.      * @ORM\Column(type="string", length=255, nullable=true)
  143.      * @var string
  144.      */
  145.     private $bannerName;
  146.     /**
  147.      * @ORM\Column(type="string", length=255, nullable=true)
  148.      */
  149.     private $bannerLink;
  150.     /**
  151.      * @ORM\Column(type="text", nullable=true)
  152.      */
  153.     private $bannerHtml;
  154.     /**
  155.      * @ORM\Column(type="datetime", nullable=true)
  156.      */
  157.     private $updatedAt;
  158.     /**
  159.      * @ORM\Column(type="boolean", nullable=true)
  160.      */
  161.     private $defaultForUS;
  162.     /**
  163.      * Helper field (not mapped by Doctrine) – active courses counter.
  164.      */
  165.     public int $activeCoursesCounter 0;
  166.     /**
  167.      * Helper field (not mapped by Doctrine) – children categories used to build the tree.
  168.      * @var iterable<Category>
  169.      */
  170.     public iterable $subCategories = [];
  171.     /**
  172.      * If manually uploading a file (i.e. not using Symfony Form) ensure an instance
  173.      * of 'UploadedFile' is injected into this setter to trigger the  update. If this
  174.      * bundle's configuration parameter 'inject_on_load' is set to 'true' this setter
  175.      * must be able to accept an instance of 'File' as the bundle will inject one here
  176.      * during Doctrine hydration.
  177.      *
  178.      * @param File|\Symfony\Component\HttpFoundation\File\UploadedFile $image
  179.      *
  180.      * @return Category
  181.      */
  182.     public function setImageFile(File $image null)
  183.     {
  184.         $this->imageFile $image;
  185.         if ($image) {
  186.             // It is required that at least one field changes if you are using doctrine
  187.             // otherwise the event listeners won't be called and the file is lost
  188.             $this->updatedAt = new \DateTime('now');
  189.         }
  190.         return $this;
  191.     }
  192.     /**
  193.      * @return File|null
  194.      */
  195.     public function getImageFile()
  196.     {
  197.         return $this->imageFile;
  198.     }
  199.     /**
  200.      * @param string $imageName
  201.      *
  202.      * @return Category
  203.      */
  204.     public function setImageName($imageName)
  205.     {
  206.         $this->imageName $imageName;
  207.         return $this;
  208.     }
  209.     /**
  210.      * @return string|null
  211.      */
  212.     public function getImageName()
  213.     {
  214.         return $this->imageName;
  215.     }
  216.     /**
  217.      * If manually uploading a file (i.e. not using Symfony Form) ensure an instance
  218.      * of 'UploadedFile' is injected into this setter to trigger the  update. If this
  219.      * bundle's configuration parameter 'inject_on_load' is set to 'true' this setter
  220.      * must be able to accept an instance of 'File' as the bundle will inject one here
  221.      * during Doctrine hydration.
  222.      *
  223.      * @param File|\Symfony\Component\HttpFoundation\File\UploadedFile $image
  224.      * @return Category
  225.      */
  226.     public function setBannerFile(File $image null): self
  227.     {
  228.         $this->bannerFile $image;
  229.         if ($image) {
  230.             // It is required that at least one field changes if you are using doctrine
  231.             // otherwise the event listeners won't be called and the file is lost
  232.             $this->updatedAt = new \DateTime('now');
  233.         }
  234.         return $this;
  235.     }
  236.     /**
  237.      * @return File|null
  238.      */
  239.     public function getBannerFile(): ?File
  240.     {
  241.         return $this->bannerFile;
  242.     }
  243.     /**
  244.      * @param string $bannerName
  245.      * @return Category
  246.      */
  247.     public function setBannerName($bannerName): self
  248.     {
  249.         $this->bannerName $bannerName;
  250.         return $this;
  251.     }
  252.     /**
  253.      * @return string|null
  254.      */
  255.     public function getBannerName(): ?string
  256.     {
  257.         return $this->bannerName;
  258.     }
  259.     public function getNotEmptyAndActiveChildren($portalSettingsId$userCourseIdArray)
  260.     {
  261.         $children = array();
  262.         /** @var Category $child */
  263.         foreach ($this->children as $child)
  264.         {
  265.             /** @var Category $child */
  266.             if (
  267.                 $child->getIsActive()
  268.                 && !empty($child->getPortalSettings())
  269.                 && $child->getPortalSettings()->getId() == $portalSettingsId
  270.                 && count($child->getAllActiveCourses($portalSettingsId$userCourseIdArray)) != 0
  271.             )
  272.             {
  273.                 $children[] = $child;
  274.             }
  275.         }
  276.         return new \Doctrine\Common\Collections\ArrayCollection($children);
  277.     }
  278.     public function getAllActiveCourses($portalSettingsId$userCourseIdArray)
  279.     {
  280.         $courses = array();
  281.         $courses $this->listActiveCategories($portalSettingsId$this->courses$courses$userCourseIdArray);
  282.         $courses $this->listActiveCategories($portalSettingsId$this->additionalCourses$courses$userCourseIdArray);
  283.         return new \Doctrine\Common\Collections\ArrayCollection($courses);
  284.     }
  285.     private function listActiveCategories($portalSettingsId$courses$return$userCourseIdArray)
  286.     {
  287.         if (!is_array($userCourseIdArray))
  288.             $userCourseIdArray = array();
  289.         $dateNow = new \DateTime();
  290.         $dateNow $dateNow->format('Y-m-d');
  291.         foreach ($courses as $course)
  292.         {
  293.             /** @var Course $course */
  294.             if (
  295.             (
  296.             (
  297.                 $course->getIsActive()
  298.                 && $course->getOriginalCourse() === null
  299.                 && !empty($course->getPortalSettings())
  300.                 && $course->getPortalSettings()->getId() == $portalSettingsId
  301.                 && (
  302.                     $course->getHideAfter() == null
  303.                     || $course->getHideAfter()->format("Y-m-d") > $dateNow
  304.                 )
  305.                 || (
  306.                     !$course->getIsActive()
  307.                     && in_array($course->getId(), $userCourseIdArray)
  308.                 )
  309.             )
  310.             )
  311.             )
  312.                 $return[] = $course;
  313.         }
  314.         return $return;
  315.     }
  316.     public function __construct()
  317.     {
  318.         $this->children                 = new ArrayCollection();
  319.         $this->courses                  = new ArrayCollection();
  320.         $this->additionalCourses        = new ArrayCollection();
  321.         $this->productAssociationMaster = new ArrayCollection();
  322.         $this->productAssociations      = new ArrayCollection();
  323.         $this->cooperators              = new ArrayCollection();
  324.         $this->author                   = new ArrayCollection();
  325.         $this->programCouncil           = new ArrayCollection();
  326.         $this->staticPages              = new ArrayCollection();
  327.     }
  328.     public function __toString()
  329.     {
  330.         return (string)$this->categoryName;
  331.     }
  332.     public function getId()
  333.     {
  334.         return $this->id;
  335.     }
  336.     public function getCategoryName()
  337.     {
  338.         return $this->categoryName;
  339.     }
  340.     public function setCategoryName(string $categoryName): self
  341.     {
  342.         $this->categoryName $categoryName;
  343.         return $this;
  344.     }
  345.     public function getCategorySlug()
  346.     {
  347.         return $this->categorySlug;
  348.     }
  349.     public function setCategorySlug(string $categorySlug): self
  350.     {
  351.         $this->categorySlug $categorySlug;
  352.         return $this;
  353.     }
  354.     /**
  355.      * @return Collection|Category[]
  356.      */
  357.     public function getChildren(): Collection
  358.     {
  359.         return $this->children;
  360.     }
  361.     public function setChildren($children) { //this will be an array collection so please pay attention
  362.         $this->children $children;
  363.         return $this;
  364.     }
  365.     public function addChild(Category $child): self
  366.     {
  367.         if (!$this->children->contains($child)) {
  368.             $this->children[] = $child;
  369.             $child->setParent($this);
  370.         }
  371.         return $this;
  372.     }
  373.     public function removeChild(Category $child)
  374.     {
  375.         if ($this->children->contains($child))
  376.         {
  377.             $this->children->removeElement($child);
  378.             if ($child->getParent() === $this)
  379.             {
  380.                 $child->setParent(null);
  381.             }
  382.         }
  383.         return $this;
  384.     }
  385.     public function getParent(): ?self
  386.     {
  387.         return $this->parent;
  388.     }
  389.     public function setParent(?self $parent): self
  390.     {
  391.         $this->parent $parent;
  392.         return $this;
  393.     }
  394.     public function getTemplate(): ?Template
  395.     {
  396.         return $this->template;
  397.     }
  398.     public function setTemplate(?Template $template): self
  399.     {
  400.         $this->template $template;
  401.         // set (or unset) the owning side of the relation if necessary
  402.         $newCategory $template === null null $this;
  403.         if ($newCategory !== $template->getCategory())
  404.         {
  405.             $template->setCategory($newCategory);
  406.         }
  407.         return $this;
  408.     }
  409.     public function getPosition(): ?string
  410.     {
  411.         return $this->position;
  412.     }
  413.     public function setPosition(?string $position): self
  414.     {
  415.         $this->position $position;
  416.         return $this;
  417.     }
  418.     public function getRecommendedProductAssociation(): ?ProductAssociation
  419.     {
  420.         return $this->recommendedProductAssociation;
  421.     }
  422.     public function setRecommendedProductAssociation(?ProductAssociation $recommendedProductAssociation): self
  423.     {
  424.         $this->recommendedProductAssociation $recommendedProductAssociation;
  425.         return $this;
  426.     }
  427.     public function getPortalSettings(): ?PortalSettings
  428.     {
  429.         return $this->portalSettings;
  430.     }
  431.     public function setPortalSettings(?PortalSettings $portalSettings): self
  432.     {
  433.         $this->portalSettings $portalSettings;
  434.         return $this;
  435.     }
  436.     /**
  437.      * @return Collection|Course[]
  438.      */
  439.     public function getCourses(): Collection
  440.     {
  441.         return $this->courses;
  442.     }
  443.     public function addCourse(Course $course): self
  444.     {
  445.         if (!$this->courses->contains($course)) {
  446.             $this->courses[] = $course;
  447.             $course->setCategory($this);
  448.         }
  449.         return $this;
  450.     }
  451.     public function removeCourse(Course $course): self
  452.     {
  453.         if ($this->courses->contains($course)) {
  454.             $this->courses->removeElement($course);
  455.             // set the owning side to null (unless already changed)
  456.             if ($course->getCategory() === $this) {
  457.                 $course->setCategory(null);
  458.             }
  459.         }
  460.         return $this;
  461.     }
  462.     /**
  463.      * @return Collection|Course[]
  464.      */
  465.     public function getAdditionalCourses(): Collection
  466.     {
  467.         return $this->additionalCourses;
  468.     }
  469.     public function addAdditionalCourse(Course $additionalCourse): self
  470.     {
  471.         if (!$this->additionalCourses->contains($additionalCourse)) {
  472.             $this->additionalCourses[] = $additionalCourse;
  473.             $additionalCourse->addAdditionalCategory($this);
  474.         }
  475.         return $this;
  476.     }
  477.     public function removeAdditionalCourse(Course $additionalCourse): self
  478.     {
  479.         if ($this->additionalCourses->contains($additionalCourse)) {
  480.             $this->additionalCourses->removeElement($additionalCourse);
  481.             $additionalCourse->removeAdditionalCategory($this);
  482.         }
  483.         return $this;
  484.     }
  485.     public function getIsActive(): ?bool
  486.     {
  487.         return $this->isActive;
  488.     }
  489.     public function setIsActive(?bool $isActive): self
  490.     {
  491.         $this->isActive $isActive;
  492.         return $this;
  493.     }
  494.     public function getLanguage(): ?Language
  495.     {
  496.         return $this->language;
  497.     }
  498.     public function setLanguage(?Language $language): self
  499.     {
  500.         $this->language $language;
  501.         return $this;
  502.     }
  503.     public function getMetaTags(): ?MetaTags
  504.     {
  505.         return $this->metaTags;
  506.     }
  507.     public function setMetaTags(?MetaTags $metaTags): self
  508.     {
  509.         $this->metaTags $metaTags;
  510.         // set (or unset) the owning side of the relation if necessary
  511.         $newCategory $metaTags === null null $this;
  512.         if ($newCategory !== $metaTags->getCategory()) {
  513.             $metaTags->setCategory($newCategory);
  514.         }
  515.         return $this;
  516.     }
  517.     /**
  518.      * @return Collection|ProductAssociation[]
  519.      */
  520.     public function getProductAssociationMaster(): Collection
  521.     {
  522.         return $this->productAssociationMaster;
  523.     }
  524.     public function addProductAssociationMaster(ProductAssociation $productAssociationMaster): self
  525.     {
  526.         if (!$this->productAssociationMaster->contains($productAssociationMaster)) {
  527.             $this->productAssociationMaster[] = $productAssociationMaster;
  528.             $productAssociationMaster->setCategoryMaster($this);
  529.         }
  530.         return $this;
  531.     }
  532.     public function removeProductAssociationMaster(ProductAssociation $productAssociationMaster): self
  533.     {
  534.         if ($this->productAssociationMaster->contains($productAssociationMaster)) {
  535.             $this->productAssociationMaster->removeElement($productAssociationMaster);
  536.             // set the owning side to null (unless already changed)
  537.             if ($productAssociationMaster->getCategoryMaster() === $this) {
  538.                 $productAssociationMaster->setCategoryMaster(null);
  539.             }
  540.         }
  541.         return $this;
  542.     }
  543.     /**
  544.      * @return Collection|ProductAssociation[]
  545.      */
  546.     public function getProductAssociations(): Collection
  547.     {
  548.         return $this->productAssociations;
  549.     }
  550.     public function addProductAssociation(ProductAssociation $productAssociation): self
  551.     {
  552.         if (!$this->productAssociations->contains($productAssociation)) {
  553.             $this->productAssociations[] = $productAssociation;
  554.         }
  555.         return $this;
  556.     }
  557.     public function removeProductAssociation(ProductAssociation $productAssociation): self
  558.     {
  559.         if ($this->productAssociations->contains($productAssociation)) {
  560.             $this->productAssociations->removeElement($productAssociation);
  561.         }
  562.         return $this;
  563.     }
  564.     /**
  565.      * @return Collection|Author[]
  566.      */
  567.     public function getAuthor(): Collection
  568.     {
  569.         return $this->author;
  570.     }
  571.     public function addAuthor(Author $author): self
  572.     {
  573.         if (!$this->author->contains($author)) {
  574.             $this->author[] = $author;
  575.             $author->addCategory($this);
  576.         }
  577.         return $this;
  578.     }
  579.     public function removeAuthor(Author $author): self
  580.     {
  581.         if ($this->author->contains($author)) {
  582.             $this->author->removeElement($author);
  583.             $author->removeCategory($this);
  584.         }
  585.         return $this;
  586.     }
  587.     /**
  588.      * @return Collection|Author[]
  589.      */
  590.     public function getProgramCouncil(): Collection
  591.     {
  592.         return $this->programCouncil;
  593.     }
  594.     public function addProgramCouncil(Author $programCouncil): self
  595.     {
  596.         if (!$this->programCouncil->contains($programCouncil)) {
  597.             $this->programCouncil[] = $programCouncil;
  598.             $programCouncil->addCategoriesProgramCouncil($this);
  599.         }
  600.         return $this;
  601.     }
  602.     public function removeProgramCouncil(Author $programCouncil): self
  603.     {
  604.         if ($this->programCouncil->contains($programCouncil)) {
  605.             $this->programCouncil->removeElement($programCouncil);
  606.             $programCouncil->removeCategoriesProgramCouncil($this);
  607.         }
  608.         return $this;
  609.     }
  610.     /**
  611.      * @return Collection|Cooperator[]
  612.      */
  613.     public function getCooperators(): Collection
  614.     {
  615.         return $this->cooperators;
  616.     }
  617.     public function addCooperator(Cooperator $cooperator): self
  618.     {
  619.         if (!$this->cooperators->contains($cooperator)) {
  620.             $this->cooperators[] = $cooperator;
  621.         }
  622.         return $this;
  623.     }
  624.     public function removeCooperator(Cooperator $cooperator): self
  625.     {
  626.         if ($this->cooperators->contains($cooperator)) {
  627.             $this->cooperators->removeElement($cooperator);
  628.         }
  629.         return $this;
  630.     }
  631.     /**
  632.      * @return Collection|StaticPage[]
  633.      */
  634.     public function getStaticPages(): Collection
  635.     {
  636.         return $this->staticPages;
  637.     }
  638.     public function addStaticPage(StaticPage $staticPage): self
  639.     {
  640.         if (!$this->staticPages->contains($staticPage)) {
  641.             $this->staticPages[] = $staticPage;
  642.             $staticPage->setCategory($this);
  643.         }
  644.         return $this;
  645.     }
  646.     public function removeStaticPage(StaticPage $staticPage): self
  647.     {
  648.         if ($this->staticPages->contains($staticPage)) {
  649.             $this->staticPages->removeElement($staticPage);
  650.             // set the owning side to null (unless already changed)
  651.             if ($staticPage->getCategory() === $this) {
  652.                 $staticPage->setCategory(null);
  653.             }
  654.         }
  655.         return $this;
  656.     }
  657.     public function getShortBody(): ?string
  658.     {
  659.         return $this->shortBody;
  660.     }
  661.     public function setShortBody(?string $shortBody): self
  662.     {
  663.         $this->shortBody $shortBody;
  664.         return $this;
  665.     }
  666.     public function getBody(): ?string
  667.     {
  668.         return $this->body;
  669.     }
  670.     public function setBody(?string $body): self
  671.     {
  672.         $this->body $body;
  673.         return $this;
  674.     }
  675.     public function getTestimonialsCustom(): ?string
  676.     {
  677.         return $this->testimonialsCustom;
  678.     }
  679.     public function setTestimonialsCustom(?string $testimonialsCustom): self
  680.     {
  681.         $this->testimonialsCustom $testimonialsCustom;
  682.         return $this;
  683.     }
  684.     public function getBannerLink(): ?string
  685.     {
  686.         return $this->bannerLink;
  687.     }
  688.     public function setBannerLink(?string $bannerLink): self
  689.     {
  690.         $this->bannerLink $bannerLink;
  691.         return $this;
  692.     }
  693.     public function getBannerHtml(): ?string
  694.     {
  695.         return $this->bannerHtml;
  696.     }
  697.     public function setBannerHtml(?string $bannerHtml): self
  698.     {
  699.         $this->bannerHtml $bannerHtml;
  700.         return $this;
  701.     }
  702.     public function getUpdatedAt(): ?\DateTimeInterface
  703.     {
  704.         return $this->updatedAt;
  705.     }
  706.     public function setUpdatedAt(?\DateTimeInterface $updatedAt): self
  707.     {
  708.         $this->updatedAt $updatedAt;
  709.         return $this;
  710.     }
  711.     public function getDefaultForUS(): ?bool
  712.     {
  713.         return $this->defaultForUS;
  714.     }
  715.     public function setDefaultForUS(?bool $defaultForUS): self
  716.     {
  717.         $this->defaultForUS $defaultForUS;
  718.         return $this;
  719.     }
  720. }