src/Entity/Gos/Uniqskills/Course.php line 26

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Gos\Uniqskills;
  3. use App\Entity\Gos\Category;
  4. use App\Entity\Gos\CourseNotify;
  5. use App\Entity\Gos\NotificationForUser;
  6. use App\Entity\Gos\PortalSettings;
  7. use App\Entity\Gos\ProductVariant;
  8. use App\Entity\Gos\StaticPage;
  9. use App\Entity\Gos\Uniqskills\Landing\Landing;
  10. use Doctrine\Common\Collections\ArrayCollection;
  11. use Doctrine\Common\Collections\Collection;
  12. use Doctrine\ORM\Mapping as ORM;
  13. use Gedmo\Mapping\Annotation as Gedmo;
  14. use Symfony\Component\Validator\Constraints as Assert;
  15. use Symfony\Component\HttpFoundation\File\File;
  16. use Vich\UploaderBundle\Mapping\Annotation as Vich;
  17. /**
  18.  * @ORM\Table()
  19.  * @ORM\Entity(repositoryClass="App\Repository\Gos\Uniqskills\CourseRepository")
  20.  * @Vich\Uploadable
  21.  * @ORM\HasLifecycleCallbacks
  22.  */
  23. class Course
  24. {
  25.     /**
  26.      * @ORM\Column(type="integer")
  27.      * @ORM\Id
  28.      * @ORM\GeneratedValue(strategy="IDENTITY")
  29.      */
  30.     private $id;
  31.     /**
  32.      * @ORM\Column(type="boolean", nullable=true)
  33.      */
  34.     private $isActive;
  35.     /**
  36.      * @var bool
  37.      * @ORM\Column(type="boolean")
  38.      */
  39.     private $isPremium;
  40.     /**
  41.      * @ORM\Column(type="string", length=255)
  42.      * @Assert\NotBlank()
  43.      */
  44.     private $name;
  45.     /**
  46.      * @ORM\Column(type="text")
  47.      * @Assert\NotBlank()
  48.      */
  49.     private $shortBody;
  50.     /**
  51.      * @Gedmo\Slug(fields={"name"})
  52.      * @ORM\Column(type="string", length=191, unique=true)
  53.      */
  54.     private $slug;
  55.     /**
  56.      * @ORM\Column(type="float", precision=18, scale=2)
  57.      */
  58.     private $defaultPrice;
  59.     /**
  60.      * @ORM\Column(type="integer", nullable=false)
  61.      */
  62.     private $durationHours;
  63.     /**
  64.      * @ORM\Column(type="integer", nullable=false)
  65.      */
  66.     private $durationMonths;
  67.     /**
  68.      * @ORM\Column(type="boolean", nullable=false, options={"default":true})
  69.      */
  70.     private $inscriptions;
  71.     /**
  72.      * @ORM\Column(type="text", nullable=true)
  73.      */
  74.     private $productForCos;
  75.     /**
  76.      * @ORM\Column(type="string", nullable = true)
  77.      * @Assert\File(mimeTypes={ "image/jpeg", "image/jpg", "image/png", "image/gif" })
  78.      */
  79.     private $filepath;
  80.     /**
  81.      * @ORM\Column(type="boolean")
  82.      */
  83.     private $isContinuous;
  84.     /**
  85.      * @ORM\Column(type="datetime", nullable=true)
  86.      */
  87.     private $shareDate;
  88.     /**
  89.      * @ORM\Column(type="string", nullable=true)
  90.      */
  91.     private $metaTitle;
  92.     /**
  93.      * @ORM\Column(type="string", nullable=true)
  94.      */
  95.     private $metaDescription;
  96.     /**
  97.      * @ORM\Column(type="boolean", nullable=true)
  98.      */
  99.     private $landingPage;
  100.     /**
  101.      * @ORM\Column(type="string", length=8, nullable=true)
  102.      */
  103.     private $actionNumber;
  104.     /**
  105.      * @ORM\Column(type="string", length=100, nullable=true)
  106.      */
  107.     private $fromSource;
  108.     /**
  109.      * @ORM\Column(type="datetime")
  110.      */
  111.     private $createdAt;
  112.     /**
  113.      * @ORM\Column(type="datetime", nullable=true)
  114.      */
  115.     private $updatedAt;
  116.     /**
  117.      * @ORM\Column(type="datetime", nullable=true)
  118.      */
  119.     private $hideAfter;
  120.     /**
  121.      * @ORM\Column(name="start_date", type="datetime", nullable=true)
  122.      */
  123.     private $startDate;
  124.     /**
  125.      * @ORM\Column(type="boolean")
  126.      */
  127.     private $allLessonsAccess;
  128.     /**
  129.      * @ORM\Column(type="boolean")
  130.      */
  131.     private $isNoIndex;
  132.     /**
  133.      * @ORM\Column(type="boolean")
  134.      */
  135.     private $isOrbicoAgreement;
  136.     /**
  137.      * @ORM\Column(type="boolean")
  138.      */
  139.     private $isPartnerAgreement;
  140.     /**
  141.      * @ORM\Column(type="boolean", options={"default":0})
  142.      */
  143.     private $isOnlineConference 0;
  144.     /**
  145.      * NOTE: This is not a mapped field of entity metadata, just a simple property.
  146.      *
  147.      * @Assert\File(
  148.      * maxSize="1M",
  149.      * mimeTypes={"image/png", "image/jpeg", "image/pjpeg"}
  150.      * )
  151.      *
  152.      * @Vich\UploadableField(mapping="product_image", fileNameProperty="imageName")
  153.      *
  154.      * @var File
  155.      */
  156.     private $imageFile;
  157.     /**
  158.      * @ORM\Column(type="string", length=255, nullable=true)
  159.      *
  160.      * @var string
  161.      */
  162.     private $imageName;
  163.     /**
  164.      * NOTE: This is not a mapped field of entity metadata, just a simple property.
  165.      *
  166.      * @Assert\File(
  167.      * maxSize="1M",
  168.      * mimeTypes={"image/png", "image/jpeg", "image/pjpeg"}
  169.      * )
  170.      *
  171.      * @Vich\UploadableField(mapping="ad_image", fileNameProperty="adImageName")
  172.      *
  173.      * @var File
  174.      */
  175.     private $adImageFile;
  176.     /**
  177.      * @ORM\Column(type="string", length=255, nullable=true)
  178.      *
  179.      * @var string
  180.      */
  181.     private $adImageName;
  182.     /**
  183.      * @ORM\Column(type="text", nullable=true)
  184.      */
  185.     private $adRedirectToUrl;
  186.     /**
  187.      * @ORM\Column(name="ad_start_date", type="datetime", nullable=true)
  188.      */
  189.     private $adStartDate;
  190.     /**
  191.      * @ORM\Column(name="ad_end_date", type="datetime", nullable=true)
  192.      */
  193.     private $adEndDate;
  194.     /**
  195.      * NOTE: This is not a mapped field of entity metadata, just a simple property.
  196.      *
  197.      * @Assert\File(
  198.      * maxSize="1M",
  199.      * mimeTypes={"image/png", "image/jpeg", "image/pjpeg"}
  200.      * )
  201.      *
  202.      * @Vich\UploadableField(mapping="module_background_image", fileNameProperty="moduleBackgroundImageName")
  203.      *
  204.      * @var File
  205.      */
  206.     private $moduleBackgroundImageFile;
  207.     /**
  208.      * @ORM\Column(type="string", length=255, nullable=true)
  209.      *
  210.      * @var string
  211.      */
  212.     private $moduleBackgroundImageName;
  213.     /**
  214.      * @ORM\ManyToOne(targetEntity="Course", inversedBy="prevCourse")
  215.      * @ORM\JoinColumn()
  216.      */
  217.     private $nextCourse;
  218.     /**
  219.      * @ORM\OneToMany(targetEntity="Course", mappedBy="nextCourse")
  220.      */
  221.     private $prevCourse;
  222.     /**
  223.      * @ORM\Column(type="text", nullable=true)
  224.      */
  225.     private $redirectToUrl;
  226.     /**
  227.      * @ORM\ManyToOne(targetEntity="CourseKeyword", inversedBy="mainCourses")
  228.      */
  229.     private $mainKeyword;
  230.     /**
  231.      * @ORM\ManyToMany(targetEntity="CourseKeyword", inversedBy="additionalCourses")
  232.      * @ORM\JoinTable(name="courses_additional_keywords")
  233.      */
  234.     private $additionalKeywords;
  235.     /**
  236.      * @ORM\OneToOne(targetEntity="App\Entity\Gos\Uniqskills\Landing\Landing", mappedBy="course")
  237.      */
  238.     private $newLandingPage;
  239.     /**
  240.      * @ORM\ManyToMany(targetEntity="Course")
  241.      * @ORM\JoinTable(name="course_suggested")
  242.      */
  243.     private $course;
  244.     /**
  245.      * @ORM\OneToMany(targetEntity="Module", mappedBy="course")
  246.      */
  247.     private $module;
  248.     /**
  249.      * @ORM\OneToMany(targetEntity="Package", mappedBy="course")
  250.      */
  251.     private $package;
  252.     /**
  253.      * @ORM\ManyToOne(targetEntity="CourseType",)
  254.      * @ORM\JoinColumn()
  255.      */
  256.     private $courseType;
  257.     /**
  258.      * @ORM\ManyToOne(targetEntity="App\Entity\Gos\Category", inversedBy="courses")
  259.      * @ORM\JoinColumn()
  260.      */
  261.     private $category;
  262.     /**
  263.      * @ORM\ManyToMany(targetEntity="App\Entity\Gos\Category", inversedBy="additionalCourses")
  264.      * @ORM\JoinTable(name="courses_additional_categories")
  265.      */
  266.     private $additionalCategories;
  267.     /**
  268.      * @ORM\OneToMany(targetEntity="Test", mappedBy="course")
  269.      */
  270.     private $test;
  271.     /**
  272.      * @ORM\ManyToOne(targetEntity="Cooperator", inversedBy="course")
  273.      * @ORM\JoinColumn()
  274.      */
  275.     private $cooperator;
  276.     /**
  277.      * @ORM\OneToMany(targetEntity="App\Entity\Gos\StaticPage", mappedBy="course")
  278.      */
  279.     private $staticPage;
  280.     /**
  281.      * @ORM\OneToMany(targetEntity="App\Entity\Gos\Uniqskills\OrderError", mappedBy="course")
  282.      */
  283.     private $ordersError;
  284.     /**
  285.      * @ORM\ManyToMany(targetEntity="Author")
  286.      * @ORM\JoinTable(name="course_author",
  287.      *      joinColumns={@ORM\JoinColumn(name="course_id", referencedColumnName="id")},
  288.      *      inverseJoinColumns={@ORM\JoinColumn(name="author_id", referencedColumnName="id")}
  289.      *      )
  290.      */
  291.     private $authors;
  292.     /**
  293.      * @ORM\ManyToMany(targetEntity="App\Entity\Gos\Uniqskills\Testimonial")
  294.      * @ORM\JoinTable(name="course_testimonial",
  295.      *      joinColumns={@ORM\JoinColumn(name="course_id", referencedColumnName="id")},
  296.      *      inverseJoinColumns={@ORM\JoinColumn(name="testimonial_id", referencedColumnName="id")}
  297.      *      )
  298.      */
  299.     private $testimonials;
  300.     /**
  301.      * @ORM\ManyToOne(targetEntity="App\Entity\Gos\PortalSettings", inversedBy="course")
  302.      * @ORM\JoinColumn()
  303.      */
  304.     private $portalSettings;
  305.     /**
  306.      * @ORM\OneToOne(targetEntity="App\Entity\Gos\Uniqskills\Voucher", mappedBy="course")
  307.      */
  308.     private $voucher;
  309.     /**
  310.      * @ORM\ManyToMany(targetEntity="App\Entity\Gos\ProductVariant", mappedBy="courses")
  311.      */
  312.     private $productVariants;
  313.     /**
  314.      * @ORM\OneToMany(targetEntity="App\Entity\Gos\Uniqskills\Certificate", mappedBy="course")
  315.      */
  316.     private $certificates;
  317.     /**
  318.      * @ORM\Column(type="integer", nullable=true)
  319.      */
  320.     private $catalogPosition;
  321.     /**
  322.      * @ORM\OneToOne(targetEntity="App\Entity\Gos\Uniqskills\Course", mappedBy="originalCourse")
  323.      */
  324.     private $virtualCourse;
  325.     /**
  326.      * @ORM\OneToOne(targetEntity="App\Entity\Gos\Uniqskills\Course", inversedBy="virtualCourse")
  327.      */
  328.     private $originalCourse;
  329.     /**
  330.      * @ORM\ManyToMany(targetEntity="App\Entity\Gos\NotificationForUser", mappedBy="courses")
  331.      */
  332.     private $notificationForUsers;
  333.     /**
  334.      * @ORM\Column(type="integer", nullable=true)
  335.      */
  336.     private $durationWeeks;
  337.     /**
  338.      * @ORM\Column(type="string", length=255, nullable=true)
  339.      */
  340.     private $durationPerWeek;
  341.     /**
  342.      * @ORM\Column(type="boolean", options={"default":0})
  343.      */
  344.     private $hasMedicalContent 0;
  345.     /**
  346.      * @ORM\OneToMany(targetEntity=CourseNotify::class, mappedBy="course")
  347.      */
  348.     private $courseNotifies;
  349.     /** @ORM\PrePersist() */
  350.     public function prePersist()
  351.     {
  352.         $this->createdAt = new \DateTime();
  353.     }
  354.     /** @ORM\PreUpdate() */
  355.     public function preUpdate()
  356.     {
  357.         $this->updatedAt = new \DateTime();
  358.     }
  359.     public function __toString()
  360.     {
  361.         return (string)$this->name;
  362.     }
  363.     /**
  364.      * If manually uploading a file (i.e. not using Symfony Form) ensure an instance
  365.      * of 'UploadedFile' is injected into this setter to trigger the  update. If this
  366.      * bundle's configuration parameter 'inject_on_load' is set to 'true' this setter
  367.      * must be able to accept an instance of 'File' as the bundle will inject one here
  368.      * during Doctrine hydration.
  369.      *
  370.      * @param File|\Symfony\Component\HttpFoundation\File\UploadedFile $image
  371.      *
  372.      * @return Course
  373.      */
  374.     public function setImageFile(File $image null)
  375.     {
  376.         $this->imageFile $image;
  377.         if ($image)
  378.         {
  379.             // It is required that at least one field changes if you are using doctrine
  380.             // otherwise the event listeners won't be called and the file is lost
  381.             $this->updatedAt = new \DateTimeImmutable();
  382.         }
  383.         return $this;
  384.     }
  385.     /**
  386.      * @return File|null
  387.      */
  388.     public function getImageFile()
  389.     {
  390.         return $this->imageFile;
  391.     }
  392.     /**
  393.      * @param string $imageName
  394.      *
  395.      * @return Course
  396.      */
  397.     public function setImageName($imageName)
  398.     {
  399.         $this->imageName $imageName;
  400.         return $this;
  401.     }
  402.     /**
  403.      * @return string|null
  404.      */
  405.     public function getImageName()
  406.     {
  407.         return $this->imageName;
  408.     }
  409.     /**
  410.      * If manually uploading a file (i.e. not using Symfony Form) ensure an instance
  411.      * of 'UploadedFile' is injected into this setter to trigger the  update. If this
  412.      * bundle's configuration parameter 'inject_on_load' is set to 'true' this setter
  413.      * must be able to accept an instance of 'File' as the bundle will inject one here
  414.      * during Doctrine hydration.
  415.      *
  416.      * @param File|\Symfony\Component\HttpFoundation\File\UploadedFile $adImage
  417.      *
  418.      * @return Course
  419.      */
  420.     public function setAdImageFile(File $adImage null)
  421.     {
  422.         $this->adImageFile $adImage;
  423.         if ($adImage)
  424.         {
  425.             // It is required that at least one field changes if you are using doctrine
  426.             // otherwise the event listeners won't be called and the file is lost
  427.             $this->updatedAt = new \DateTimeImmutable();
  428.         }
  429.         return $this;
  430.     }
  431.     /**
  432.      * @return File|null
  433.      */
  434.     public function getAdImageFile()
  435.     {
  436.         return $this->adImageFile;
  437.     }
  438.     /**
  439.      * @param string $adImageName
  440.      *
  441.      * @return Course
  442.      */
  443.     public function setAdImageName($adImageName)
  444.     {
  445.         $this->adImageName $adImageName;
  446.         return $this;
  447.     }
  448.     /**
  449.      * @return string|null
  450.      */
  451.     public function getAdImageName()
  452.     {
  453.         return $this->adImageName;
  454.     }
  455.     /**
  456.      * If manually uploading a file (i.e. not using Symfony Form) ensure an instance
  457.      * of 'UploadedFile' is injected into this setter to trigger the  update. If this
  458.      * bundle's configuration parameter 'inject_on_load' is set to 'true' this setter
  459.      * must be able to accept an instance of 'File' as the bundle will inject one here
  460.      * during Doctrine hydration.
  461.      *
  462.      * @param File|\Symfony\Component\HttpFoundation\File\UploadedFile $image
  463.      *
  464.      * @return Course
  465.      */
  466.     public function setModuleBackgroundImageFile(File $image null)
  467.     {
  468.         $this->moduleBackgroundImageFile $image;
  469.         if ($image)
  470.         {
  471.             // It is required that at least one field changes if you are using doctrine
  472.             // otherwise the event listeners won't be called and the file is lost
  473.             $this->updatedAt = new \DateTimeImmutable();
  474.         }
  475.         return $this;
  476.     }
  477.     /**
  478.      * @return File|null
  479.      */
  480.     public function getModuleBackgroundImageFile()
  481.     {
  482.         return $this->moduleBackgroundImageFile;
  483.     }
  484.     /**
  485.      * @param string $moduleBackgroundImageName
  486.      *
  487.      * @return Course
  488.      */
  489.     public function setModuleBackgroundImageName($moduleBackgroundImageName)
  490.     {
  491.         $this->moduleBackgroundImageName $moduleBackgroundImageName;
  492.         return $this;
  493.     }
  494.     /**
  495.      * @return string|null
  496.      */
  497.     public function getModuleBackgroundImageName()
  498.     {
  499.         return $this->moduleBackgroundImageName;
  500.     }
  501.     /**
  502.      * Constructor
  503.      */
  504.     public function __construct()
  505.     {
  506.         $this->discountCode             = new \Doctrine\Common\Collections\ArrayCollection();
  507.         $this->module                   = new \Doctrine\Common\Collections\ArrayCollection();
  508.         $this->package                  = new \Doctrine\Common\Collections\ArrayCollection();
  509.         $this->staticPage               = new \Doctrine\Common\Collections\ArrayCollection();
  510.         $this->orders                   = new \Doctrine\Common\Collections\ArrayCollection();
  511.         $this->files                    = new \Doctrine\Common\Collections\ArrayCollection();
  512.         $this->authors                  = new \Doctrine\Common\Collections\ArrayCollection();
  513.         $this->additionalCategories     = new \Doctrine\Common\Collections\ArrayCollection();
  514.         $this->additionalKeywords       = new \Doctrine\Common\Collections\ArrayCollection();
  515.         $this->prevCourse               = new ArrayCollection();
  516.         $this->course                   = new ArrayCollection();
  517.         $this->productVariant           = new ArrayCollection();
  518.         $this->test                     = new ArrayCollection();
  519.         $this->testimonials             = new ArrayCollection();
  520.         $this->ordersError              = new ArrayCollection();
  521.         $this->productVariants          = new ArrayCollection();
  522.         $this->certificates             = new ArrayCollection();
  523.         $this->notificationForUsers     = new ArrayCollection();
  524.         $this->courseNotifies = new ArrayCollection();
  525.     }
  526.     public function __clone()
  527.     {
  528.         $this->id           null;
  529.         $this->updatedAt    null;
  530.     }
  531.     public function getAllKeywords()
  532.     {
  533.         return new \Doctrine\Common\Collections\ArrayCollection(
  534.             array_merge(
  535.                 $this->getAdditionalKeywords()->toArray(),
  536.                 array($this->getMainKeyword())
  537.             )
  538.         );
  539.     }
  540.     public function clearModule()
  541.     {
  542.         $this->module null;
  543.     }
  544.     public function clearNewLandingPage()
  545.     {
  546.         $this->newLandingPage null;
  547.     }
  548.     /* ****************************** GETTERS & SETTERS ******************************  */
  549.     public function getId(): ?int
  550.     {
  551.         return $this->id;
  552.     }
  553.     public function getIsActive(): ?bool
  554.     {
  555.         return $this->isActive;
  556.     }
  557.     public function setIsActive(?bool $isActive): self
  558.     {
  559.         $this->isActive $isActive;
  560.         return $this;
  561.     }
  562.     public function getIsPremium(): ?bool
  563.     {
  564.         return $this->isPremium;
  565.     }
  566.     public function setIsPremium(bool $isPremium): self
  567.     {
  568.         $this->isPremium $isPremium;
  569.         return $this;
  570.     }
  571.     public function getName(): ?string
  572.     {
  573.         return $this->name;
  574.     }
  575.     public function setName(string $name): self
  576.     {
  577.         $this->name $name;
  578.         return $this;
  579.     }
  580.     public function getShortBody(): ?string
  581.     {
  582.         return $this->shortBody;
  583.     }
  584.     public function setShortBody(string $shortBody): self
  585.     {
  586.         $this->shortBody $shortBody;
  587.         return $this;
  588.     }
  589.     public function getSlug(): ?string
  590.     {
  591.         return $this->slug;
  592.     }
  593.     public function setSlug($slug): self
  594.     {
  595.         $this->slug $slug;
  596.         return $this;
  597.     }
  598.     public function getDefaultPrice(): ?float
  599.     {
  600.         return $this->defaultPrice;
  601.     }
  602.     public function setDefaultPrice(float $defaultPrice): self
  603.     {
  604.         $this->defaultPrice $defaultPrice;
  605.         return $this;
  606.     }
  607.     public function getDurationHours(): ?int
  608.     {
  609.         return $this->durationHours;
  610.     }
  611.     public function setDurationHours(int $durationHours): self
  612.     {
  613.         $this->durationHours $durationHours;
  614.         return $this;
  615.     }
  616.     public function getDurationMonths(): ?int
  617.     {
  618.         return $this->durationMonths;
  619.     }
  620.     public function setDurationMonths(int $durationMonths): self
  621.     {
  622.         $this->durationMonths $durationMonths;
  623.         return $this;
  624.     }
  625.     public function getInscriptions(): ?bool
  626.     {
  627.         return $this->inscriptions;
  628.     }
  629.     public function setInscriptions(bool $inscriptions): self
  630.     {
  631.         $this->inscriptions $inscriptions;
  632.         return $this;
  633.     }
  634.     public function getProductForCos(): ?string
  635.     {
  636.         return $this->productForCos;
  637.     }
  638.     public function setProductForCos(?string $productForCos): self
  639.     {
  640.         $this->productForCos $productForCos;
  641.         return $this;
  642.     }
  643.     public function getFilepath(): ?string
  644.     {
  645.         return $this->filepath;
  646.     }
  647.     public function setFilepath(?string $filepath): self
  648.     {
  649.         $this->filepath $filepath;
  650.         return $this;
  651.     }
  652.     public function getIsContinuous(): ?bool
  653.     {
  654.         return $this->isContinuous;
  655.     }
  656.     public function setIsContinuous(bool $isContinuous): self
  657.     {
  658.         $this->isContinuous $isContinuous;
  659.         return $this;
  660.     }
  661.     public function getShareDate(): ?\DateTimeInterface
  662.     {
  663.         return $this->shareDate;
  664.     }
  665.     public function setShareDate(?\DateTimeInterface $shareDate): self
  666.     {
  667.         $this->shareDate $shareDate;
  668.         return $this;
  669.     }
  670.     public function getMetaTitle(): ?string
  671.     {
  672.         return $this->metaTitle;
  673.     }
  674.     public function setMetaTitle(?string $metaTitle): self
  675.     {
  676.         $this->metaTitle $metaTitle;
  677.         return $this;
  678.     }
  679.     public function getMetaDescription(): ?string
  680.     {
  681.         return $this->metaDescription;
  682.     }
  683.     public function setMetaDescription(?string $metaDescription): self
  684.     {
  685.         $this->metaDescription $metaDescription;
  686.         return $this;
  687.     }
  688.     public function getLandingPage(): ?bool
  689.     {
  690.         return $this->landingPage;
  691.     }
  692.     public function setLandingPage(?bool $landingPage): self
  693.     {
  694.         $this->landingPage $landingPage;
  695.         return $this;
  696.     }
  697.     public function getActionNumber(): ?string
  698.     {
  699.         return $this->actionNumber;
  700.     }
  701.     public function setActionNumber(?string $actionNumber): self
  702.     {
  703.         $this->actionNumber $actionNumber;
  704.         return $this;
  705.     }
  706.     public function getFromSource(): ?string
  707.     {
  708.         return $this->fromSource;
  709.     }
  710.     public function setFromSource(?string $fromSource): self
  711.     {
  712.         $this->fromSource $fromSource;
  713.         return $this;
  714.     }
  715.     public function getCreatedAt(): ?\DateTimeInterface
  716.     {
  717.         return $this->createdAt;
  718.     }
  719.     public function setCreatedAt(\DateTimeInterface $createdAt): self
  720.     {
  721.         $this->createdAt $createdAt;
  722.         return $this;
  723.     }
  724.     public function getUpdatedAt(): ?\DateTimeInterface
  725.     {
  726.         return $this->updatedAt;
  727.     }
  728.     public function setUpdatedAt(?\DateTimeInterface $updatedAt): self
  729.     {
  730.         $this->updatedAt $updatedAt;
  731.         return $this;
  732.     }
  733.     public function getHideAfter(): ?\DateTimeInterface
  734.     {
  735.         return $this->hideAfter;
  736.     }
  737.     public function setHideAfter(?\DateTimeInterface $hideAfter): self
  738.     {
  739.         $this->hideAfter $hideAfter;
  740.         return $this;
  741.     }
  742.     public function getStartDate(): ?\DateTimeInterface
  743.     {
  744.         return $this->startDate;
  745.     }
  746.     public function setStartDate(?\DateTimeInterface $startDate): self
  747.     {
  748.         $this->startDate $startDate;
  749.         return $this;
  750.     }
  751.     public function getAdStartDate(): ?\DateTimeInterface
  752.     {
  753.         return $this->adStartDate;
  754.     }
  755.     public function setAdStartDate(?\DateTimeInterface $adStartDate): self
  756.     {
  757.         $this->adStartDate $adStartDate;
  758.         return $this;
  759.     }
  760.     public function getAdEndDate(): ?\DateTimeInterface
  761.     {
  762.         return $this->adEndDate;
  763.     }
  764.     public function setAdEndDate(?\DateTimeInterface $adEndDate): self
  765.     {
  766.         $this->adEndDate $adEndDate;
  767.         return $this;
  768.     }
  769.     public function getAllLessonsAccess(): ?bool
  770.     {
  771.         return $this->allLessonsAccess;
  772.     }
  773.     public function setAllLessonsAccess(bool $allLessonsAccess): self
  774.     {
  775.         $this->allLessonsAccess $allLessonsAccess;
  776.         return $this;
  777.     }
  778.     public function getIsNoIndex(): ?bool
  779.     {
  780.         return $this->isNoIndex;
  781.     }
  782.     public function setIsNoIndex(bool $isNoIndex): self
  783.     {
  784.         $this->isNoIndex $isNoIndex;
  785.         return $this;
  786.     }
  787.     public function getIsOrbicoAgreement(): ?bool
  788.     {
  789.         return $this->isOrbicoAgreement;
  790.     }
  791.     public function setIsOrbicoAgreement(bool $isOrbicoAgreement): self
  792.     {
  793.         $this->isOrbicoAgreement $isOrbicoAgreement;
  794.         return $this;
  795.     }
  796.     public function getIsPartnerAgreement(): ?bool
  797.     {
  798.         return $this->isPartnerAgreement;
  799.     }
  800.     public function setIsPartnerAgreement(bool $isPartnerAgreement): self
  801.     {
  802.         $this->isPartnerAgreement $isPartnerAgreement;
  803.         return $this;
  804.     }
  805.     public function getNextCourse(): ?self
  806.     {
  807.         return $this->nextCourse;
  808.     }
  809.     public function setNextCourse(?self $nextCourse): self
  810.     {
  811.         $this->nextCourse $nextCourse;
  812.         return $this;
  813.     }
  814.     /**
  815.      * @return Collection|Course[]
  816.      */
  817.     public function getPrevCourse(): Collection
  818.     {
  819.         return $this->prevCourse;
  820.     }
  821.     public function addPrevCourse(Course $prevCourse): self
  822.     {
  823.         if (!$this->prevCourse->contains($prevCourse)) {
  824.             $this->prevCourse[] = $prevCourse;
  825.             $prevCourse->setNextCourse($this);
  826.         }
  827.         return $this;
  828.     }
  829.     public function removePrevCourse(Course $prevCourse): self
  830.     {
  831.         if ($this->prevCourse->contains($prevCourse)) {
  832.             $this->prevCourse->removeElement($prevCourse);
  833.             // set the owning side to null (unless already changed)
  834.             if ($prevCourse->getNextCourse() === $this) {
  835.                 $prevCourse->setNextCourse(null);
  836.             }
  837.         }
  838.         return $this;
  839.     }
  840.     public function getMainKeyword(): ?CourseKeyword
  841.     {
  842.         return $this->mainKeyword;
  843.     }
  844.     public function setMainKeyword(?CourseKeyword $mainKeyword): self
  845.     {
  846.         $this->mainKeyword $mainKeyword;
  847.         return $this;
  848.     }
  849.     /**
  850.      * @return Collection|CourseKeyword[]
  851.      */
  852.     public function getAdditionalKeywords(): Collection
  853.     {
  854.         return $this->additionalKeywords;
  855.     }
  856.     public function addAdditionalKeyword(CourseKeyword $additionalKeyword): self
  857.     {
  858.         if (!$this->additionalKeywords->contains($additionalKeyword)) {
  859.             $this->additionalKeywords[] = $additionalKeyword;
  860.         }
  861.         return $this;
  862.     }
  863.     public function removeAdditionalKeyword(CourseKeyword $additionalKeyword): self
  864.     {
  865.         if ($this->additionalKeywords->contains($additionalKeyword)) {
  866.             $this->additionalKeywords->removeElement($additionalKeyword);
  867.         }
  868.         return $this;
  869.     }
  870.     public function getNewLandingPage(): ?Landing
  871.     {
  872.         return $this->newLandingPage;
  873.     }
  874.     public function setNewLandingPage(?Landing $newLandingPage): self
  875.     {
  876.         $this->newLandingPage $newLandingPage;
  877.         // set (or unset) the owning side of the relation if necessary
  878.         $newCourse $newLandingPage === null null $this;
  879.         if ($newCourse !== $newLandingPage->getCourse()) {
  880.             $newLandingPage->setCourse($newCourse);
  881.         }
  882.         return $this;
  883.     }
  884.     /**
  885.      * @return Collection|Course[]
  886.      */
  887.     public function getCourse(): Collection
  888.     {
  889.         return $this->course;
  890.     }
  891.     public function addCourse(Course $course): self
  892.     {
  893.         if (!$this->course->contains($course)) {
  894.             $this->course[] = $course;
  895.         }
  896.         return $this;
  897.     }
  898.     public function removeCourse(Course $course): self
  899.     {
  900.         if ($this->course->contains($course)) {
  901.             $this->course->removeElement($course);
  902.         }
  903.         return $this;
  904.     }
  905.     /**
  906.      * @return Collection|Module[]
  907.      */
  908.     public function getModule(): Collection
  909.     {
  910.         return $this->module;
  911.     }
  912.     public function addModule(Module $module): self
  913.     {
  914.         if (!$this->module->contains($module)) {
  915.             $this->module[] = $module;
  916.             $module->setCourse($this);
  917.         }
  918.         return $this;
  919.     }
  920.     public function removeModule(Module $module): self
  921.     {
  922.         if ($this->module->contains($module)) {
  923.             $this->module->removeElement($module);
  924.             // set the owning side to null (unless already changed)
  925.             if ($module->getCourse() === $this) {
  926.                 $module->setCourse(null);
  927.             }
  928.         }
  929.         return $this;
  930.     }
  931.     /**
  932.      * @return Collection|Package[]
  933.      */
  934.     public function getPackage(): Collection
  935.     {
  936.         return $this->package;
  937.     }
  938.     public function addPackage(Package $package): self
  939.     {
  940.         if (!$this->package->contains($package)) {
  941.             $this->package[] = $package;
  942.             $package->setCourse($this);
  943.         }
  944.         return $this;
  945.     }
  946.     public function removePackage(Package $package): self
  947.     {
  948.         if ($this->package->contains($package)) {
  949.             $this->package->removeElement($package);
  950.             // set the owning side to null (unless already changed)
  951.             if ($package->getCourse() === $this) {
  952.                 $package->setCourse(null);
  953.             }
  954.         }
  955.         return $this;
  956.     }
  957.     public function getCourseType(): ?CourseType
  958.     {
  959.         return $this->courseType;
  960.     }
  961.     public function setCourseType(?CourseType $courseType): self
  962.     {
  963.         $this->courseType $courseType;
  964.         return $this;
  965.     }
  966.     /**
  967.      * @return Collection|Test[]
  968.      */
  969.     public function getTest(): Collection
  970.     {
  971.         return $this->test;
  972.     }
  973.     public function addTest(Test $test): self
  974.     {
  975.         if (!$this->test->contains($test)) {
  976.             $this->test[] = $test;
  977.             $test->setCourse($this);
  978.         }
  979.         return $this;
  980.     }
  981.     public function removeTest(Test $test): self
  982.     {
  983.         if ($this->test->contains($test)) {
  984.             $this->test->removeElement($test);
  985.             // set the owning side to null (unless already changed)
  986.             if ($test->getCourse() === $this) {
  987.                 $test->setCourse(null);
  988.             }
  989.         }
  990.         return $this;
  991.     }
  992.     public function getVoucher(): ?Voucher
  993.     {
  994.         return $this->voucher;
  995.     }
  996.     public function setVoucher(?Voucher $voucher): self
  997.     {
  998.         $this->voucher $voucher;
  999.         // set (or unset) the owning side of the relation if necessary
  1000.         $newCourse $voucher === null null $this;
  1001.         if ($newCourse !== $voucher->getCourse()) {
  1002.             $voucher->setCourse($newCourse);
  1003.         }
  1004.         return $this;
  1005.     }
  1006.     public function getCooperator(): ?Cooperator
  1007.     {
  1008.         return $this->cooperator;
  1009.     }
  1010.     public function setCooperator(?Cooperator $cooperator): self
  1011.     {
  1012.         $this->cooperator $cooperator;
  1013.         return $this;
  1014.     }
  1015.     public function getCategory(): ?Category
  1016.     {
  1017.         return $this->category;
  1018.     }
  1019.     public function setCategory(?Category $category): self
  1020.     {
  1021.         $this->category $category;
  1022.         return $this;
  1023.     }
  1024.     /**
  1025.      * @return Collection|Category[]
  1026.      */
  1027.     public function getAdditionalCategories(): Collection
  1028.     {
  1029.         return $this->additionalCategories;
  1030.     }
  1031.     public function addAdditionalCategory(Category $additionalCategory): self
  1032.     {
  1033.         if (!$this->additionalCategories->contains($additionalCategory)) {
  1034.             $this->additionalCategories[] = $additionalCategory;
  1035.         }
  1036.         return $this;
  1037.     }
  1038.     public function removeAdditionalCategory(Category $additionalCategory): self
  1039.     {
  1040.         if ($this->additionalCategories->contains($additionalCategory)) {
  1041.             $this->additionalCategories->removeElement($additionalCategory);
  1042.         }
  1043.         return $this;
  1044.     }
  1045.     public function getPortalSettings(): ?PortalSettings
  1046.     {
  1047.         return $this->portalSettings;
  1048.     }
  1049.     public function setPortalSettings(?PortalSettings $portalSettings): self
  1050.     {
  1051.         $this->portalSettings $portalSettings;
  1052.         return $this;
  1053.     }
  1054.     /**
  1055.      * @return Collection|Author[]
  1056.      */
  1057.     public function getAuthors(): Collection
  1058.     {
  1059.         return $this->authors;
  1060.     }
  1061.     public function addAuthor(Author $author): self
  1062.     {
  1063.         if (!$this->authors->contains($author)) {
  1064.             $this->authors[] = $author;
  1065.         }
  1066.         return $this;
  1067.     }
  1068.     public function removeAuthor(Author $author): self
  1069.     {
  1070.         if ($this->authors->contains($author)) {
  1071.             $this->authors->removeElement($author);
  1072.         }
  1073.         return $this;
  1074.     }
  1075.     /**
  1076.      * @return Collection|Testimonial[]
  1077.      */
  1078.     public function getTestimonials(): Collection
  1079.     {
  1080.         return $this->testimonials;
  1081.     }
  1082.     public function addTestimonial(Testimonial $testimonial): self
  1083.     {
  1084.         if (!$this->testimonials->contains($testimonial)) {
  1085.             $this->testimonials[] = $testimonial;
  1086.         }
  1087.         return $this;
  1088.     }
  1089.     public function removeTestimonial(Testimonial $testimonial): self
  1090.     {
  1091.         if ($this->testimonials->contains($testimonial)) {
  1092.             $this->testimonials->removeElement($testimonial);
  1093.         }
  1094.         return $this;
  1095.     }
  1096.     /**
  1097.      * @return Collection|StaticPage[]
  1098.      */
  1099.     public function getStaticPage(): Collection
  1100.     {
  1101.         return $this->staticPage;
  1102.     }
  1103.     public function addStaticPage(StaticPage $staticPage): self
  1104.     {
  1105.         if (!$this->staticPage->contains($staticPage)) {
  1106.             $this->staticPage[] = $staticPage;
  1107.             $staticPage->setCourse($this);
  1108.         }
  1109.         return $this;
  1110.     }
  1111.     public function removeStaticPage(StaticPage $staticPage): self
  1112.     {
  1113.         if ($this->staticPage->contains($staticPage)) {
  1114.             $this->staticPage->removeElement($staticPage);
  1115.             // set the owning side to null (unless already changed)
  1116.             if ($staticPage->getCourse() === $this) {
  1117.                 $staticPage->setCourse(null);
  1118.             }
  1119.         }
  1120.         return $this;
  1121.     }
  1122.     public function getRedirectToUrl(): ?string
  1123.     {
  1124.         return $this->redirectToUrl;
  1125.     }
  1126.     public function setRedirectToUrl(?string $redirectToUrl): self
  1127.     {
  1128.         $this->redirectToUrl $redirectToUrl;
  1129.         return $this;
  1130.     }
  1131.     public function getAdRedirectToUrl(): ?string
  1132.     {
  1133.         return $this->adRedirectToUrl;
  1134.     }
  1135.     public function setAdRedirectToUrl(?string $adRedirectToUrl): self
  1136.     {
  1137.         $this->adRedirectToUrl $adRedirectToUrl;
  1138.         return $this;
  1139.     }
  1140.     /**
  1141.      * @return Collection|OrderError[]
  1142.      */
  1143.     public function getOrdersError(): Collection
  1144.     {
  1145.         return $this->ordersError;
  1146.     }
  1147.     public function addOrdersError(OrderError $ordersError): self
  1148.     {
  1149.         if (!$this->ordersError->contains($ordersError)) {
  1150.             $this->ordersError[] = $ordersError;
  1151.             $ordersError->setCourse($this);
  1152.         }
  1153.         return $this;
  1154.     }
  1155.     public function removeOrdersError(OrderError $ordersError): self
  1156.     {
  1157.         if ($this->ordersError->contains($ordersError)) {
  1158.             $this->ordersError->removeElement($ordersError);
  1159.             // set the owning side to null (unless already changed)
  1160.             if ($ordersError->getCourse() === $this) {
  1161.                 $ordersError->setCourse(null);
  1162.             }
  1163.         }
  1164.         return $this;
  1165.     }
  1166.     public function getProductPacks(): Collection
  1167.     {
  1168.         $productPacks = new ArrayCollection();
  1169.         foreach ($this->getProductVariants() as $productVariant)
  1170.         {
  1171.             foreach ($productVariant->getProductPackItem() as $productPackItem)
  1172.             {
  1173.                 $productPacks->add($productPackItem->getProductPack());
  1174.             }
  1175.         }
  1176.         return $productPacks;
  1177.     }
  1178.     /**
  1179.      * @return Collection|ProductVariant[]
  1180.      */
  1181.     public function getProductVariants(): Collection
  1182.     {
  1183.         return $this->productVariants;
  1184.     }
  1185.     public function addProductVariant(ProductVariant $productVariant): self
  1186.     {
  1187.         if (!$this->productVariants->contains($productVariant)) {
  1188.             $this->productVariants[] = $productVariant;
  1189.             $productVariant->addCourse($this);
  1190.         }
  1191.         return $this;
  1192.     }
  1193.     public function removeProductVariant(ProductVariant $productVariant): self
  1194.     {
  1195.         if ($this->productVariants->contains($productVariant)) {
  1196.             $this->productVariants->removeElement($productVariant);
  1197.             $productVariant->removeCourse($this);
  1198.         }
  1199.         return $this;
  1200.     }
  1201.     /**
  1202.      * @return Collection|Certificate[]
  1203.      */
  1204.     public function getCertificates(): Collection
  1205.     {
  1206.         return $this->certificates;
  1207.     }
  1208.     public function addCertificate(Certificate $certificate): self
  1209.     {
  1210.         if (!$this->certificates->contains($certificate)) {
  1211.             $this->certificates[] = $certificate;
  1212.             $certificate->setCourse($this);
  1213.         }
  1214.         return $this;
  1215.     }
  1216.     public function removeCertificate(Certificate $certificate): self
  1217.     {
  1218.         if ($this->certificates->contains($certificate)) {
  1219.             $this->certificates->removeElement($certificate);
  1220.             // set the owning side to null (unless already changed)
  1221.             if ($certificate->getCourse() === $this) {
  1222.                 $certificate->setCourse(null);
  1223.             }
  1224.         }
  1225.         return $this;
  1226.     }
  1227.     public function getCatalogPosition(): ?int
  1228.     {
  1229.         return $this->catalogPosition;
  1230.     }
  1231.     public function setCatalogPosition(?int $catalogPosition): self
  1232.     {
  1233.         $this->catalogPosition $catalogPosition;
  1234.         return $this;
  1235.     }
  1236.     public function getVirtualCourse(): ?Course
  1237.     {
  1238.         return $this->virtualCourse;
  1239.     }
  1240.     public function setVirtualCourse(?Course $virtualCourse): self
  1241.     {
  1242.         $this->virtualCourse $virtualCourse;
  1243.         return $this;
  1244.     }
  1245.     public function getOriginalCourse(): ?Course
  1246.     {
  1247.         return $this->originalCourse;
  1248.     }
  1249.     public function setOriginalCourse(?Course $originalCourse): self
  1250.     {
  1251.         $this->originalCourse $originalCourse;
  1252.         return $this;
  1253.     }
  1254.     public function getIsOnlineConference(): bool
  1255.     {
  1256.         return $this->isOnlineConference;
  1257.     }
  1258.     public function setIsOnlineConference(bool $isOnlineConference): self
  1259.     {
  1260.         $this->isOnlineConference $isOnlineConference;
  1261.         return $this;
  1262.     }
  1263.     /**
  1264.      * @return Collection|Course[]
  1265.      */
  1266.     public function getNotificationForUsers(): Collection
  1267.     {
  1268.         return $this->notificationForUsers;
  1269.     }
  1270.     public function addNotificationForUsers(NotificationForUser $notificationForUser): self
  1271.     {
  1272.         if (!$this->notificationForUsers->contains($notificationForUser)) {
  1273.             $this->notificationForUsers[] = $notificationForUser;
  1274.             $notificationForUser->addCourses($this);
  1275.         }
  1276.         return $this;
  1277.     }
  1278.     public function removeNotificationForUsers(NotificationForUser $notificationForUser): self
  1279.     {
  1280.         if ($this->notificationForUsers->contains($notificationForUser)) {
  1281.             $this->notificationForUsers->removeElement($notificationForUser);
  1282.             $notificationForUser->removeCourses($this);
  1283.         }
  1284.         return $this;
  1285.     }
  1286.     public function getDurationWeeks(): ?int
  1287.     {
  1288.         return $this->durationWeeks;
  1289.     }
  1290.     public function setDurationWeeks(?int $durationWeeks): self
  1291.     {
  1292.         $this->durationWeeks $durationWeeks;
  1293.         return $this;
  1294.     }
  1295.     public function getDurationPerWeek(): ?string
  1296.     {
  1297.         return $this->durationPerWeek;
  1298.     }
  1299.     public function setDurationPerWeek(?string $durationPerWeek): self
  1300.     {
  1301.         $this->durationPerWeek $durationPerWeek;
  1302.         return $this;
  1303.     }
  1304.     public function getHasMedicalContent(): ?bool
  1305.     {
  1306.         return $this->hasMedicalContent;
  1307.     }
  1308.     public function setHasMedicalContent(bool $hasMedicalContent): self
  1309.     {
  1310.         $this->hasMedicalContent $hasMedicalContent;
  1311.         return $this;
  1312.     }
  1313.     public function canSendNotifciations(): bool
  1314.     {
  1315.         return $this->getIsContinuous() === false && $this->getShareDate() > new \DateTime();
  1316.     }
  1317.     /**
  1318.      * @return Collection|CourseNotify[]
  1319.      */
  1320.     public function getCourseNotifies(): Collection
  1321.     {
  1322.         return $this->courseNotifies;
  1323.     }
  1324.     public function addCourseNotify(CourseNotify $courseNotify): self
  1325.     {
  1326.         if (!$this->courseNotifies->contains($courseNotify)) {
  1327.             $this->courseNotifies[] = $courseNotify;
  1328.             $courseNotify->setCourse($this);
  1329.         }
  1330.         return $this;
  1331.     }
  1332.     public function removeCourseNotify(CourseNotify $courseNotify): self
  1333.     {
  1334.         if ($this->courseNotifies->contains($courseNotify)) {
  1335.             $this->courseNotifies->removeElement($courseNotify);
  1336.             // set the owning side to null (unless already changed)
  1337.             if ($courseNotify->getCourse() === $this) {
  1338.                 $courseNotify->setCourse(null);
  1339.             }
  1340.         }
  1341.         return $this;
  1342.     }
  1343. }