<?php
namespace App\Entity\Gos\Uniqskills;
use App\Entity\Gos\Category;
use App\Entity\Gos\CourseNotify;
use App\Entity\Gos\NotificationForUser;
use App\Entity\Gos\PortalSettings;
use App\Entity\Gos\ProductVariant;
use App\Entity\Gos\StaticPage;
use App\Entity\Gos\Uniqskills\Landing\Landing;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
use Symfony\Component\Validator\Constraints as Assert;
use Symfony\Component\HttpFoundation\File\File;
use Vich\UploaderBundle\Mapping\Annotation as Vich;
/**
* @ORM\Table()
* @ORM\Entity(repositoryClass="App\Repository\Gos\Uniqskills\CourseRepository")
* @Vich\Uploadable
* @ORM\HasLifecycleCallbacks
*/
class Course
{
/**
* @ORM\Column(type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="IDENTITY")
*/
private $id;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $isActive;
/**
* @var bool
* @ORM\Column(type="boolean")
*/
private $isPremium;
/**
* @ORM\Column(type="string", length=255)
* @Assert\NotBlank()
*/
private $name;
/**
* @ORM\Column(type="text")
* @Assert\NotBlank()
*/
private $shortBody;
/**
* @Gedmo\Slug(fields={"name"})
* @ORM\Column(type="string", length=191, unique=true)
*/
private $slug;
/**
* @ORM\Column(type="float", precision=18, scale=2)
*/
private $defaultPrice;
/**
* @ORM\Column(type="integer", nullable=false)
*/
private $durationHours;
/**
* @ORM\Column(type="integer", nullable=false)
*/
private $durationMonths;
/**
* @ORM\Column(type="boolean", nullable=false, options={"default":true})
*/
private $inscriptions;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $productForCos;
/**
* @ORM\Column(type="string", nullable = true)
* @Assert\File(mimeTypes={ "image/jpeg", "image/jpg", "image/png", "image/gif" })
*/
private $filepath;
/**
* @ORM\Column(type="boolean")
*/
private $isContinuous;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $shareDate;
/**
* @ORM\Column(type="string", nullable=true)
*/
private $metaTitle;
/**
* @ORM\Column(type="string", nullable=true)
*/
private $metaDescription;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $landingPage;
/**
* @ORM\Column(type="string", length=8, nullable=true)
*/
private $actionNumber;
/**
* @ORM\Column(type="string", length=100, nullable=true)
*/
private $fromSource;
/**
* @ORM\Column(type="datetime")
*/
private $createdAt;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $updatedAt;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $hideAfter;
/**
* @ORM\Column(name="start_date", type="datetime", nullable=true)
*/
private $startDate;
/**
* @ORM\Column(type="boolean")
*/
private $allLessonsAccess;
/**
* @ORM\Column(type="boolean")
*/
private $isNoIndex;
/**
* @ORM\Column(type="boolean")
*/
private $isOrbicoAgreement;
/**
* @ORM\Column(type="boolean")
*/
private $isPartnerAgreement;
/**
* @ORM\Column(type="boolean", options={"default":0})
*/
private $isOnlineConference = 0;
/**
* NOTE: This is not a mapped field of entity metadata, just a simple property.
*
* @Assert\File(
* maxSize="1M",
* mimeTypes={"image/png", "image/jpeg", "image/pjpeg"}
* )
*
* @Vich\UploadableField(mapping="product_image", fileNameProperty="imageName")
*
* @var File
*/
private $imageFile;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*
* @var string
*/
private $imageName;
/**
* NOTE: This is not a mapped field of entity metadata, just a simple property.
*
* @Assert\File(
* maxSize="1M",
* mimeTypes={"image/png", "image/jpeg", "image/pjpeg"}
* )
*
* @Vich\UploadableField(mapping="ad_image", fileNameProperty="adImageName")
*
* @var File
*/
private $adImageFile;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*
* @var string
*/
private $adImageName;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $adRedirectToUrl;
/**
* @ORM\Column(name="ad_start_date", type="datetime", nullable=true)
*/
private $adStartDate;
/**
* @ORM\Column(name="ad_end_date", type="datetime", nullable=true)
*/
private $adEndDate;
/**
* NOTE: This is not a mapped field of entity metadata, just a simple property.
*
* @Assert\File(
* maxSize="1M",
* mimeTypes={"image/png", "image/jpeg", "image/pjpeg"}
* )
*
* @Vich\UploadableField(mapping="module_background_image", fileNameProperty="moduleBackgroundImageName")
*
* @var File
*/
private $moduleBackgroundImageFile;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*
* @var string
*/
private $moduleBackgroundImageName;
/**
* @ORM\ManyToOne(targetEntity="Course", inversedBy="prevCourse")
* @ORM\JoinColumn()
*/
private $nextCourse;
/**
* @ORM\OneToMany(targetEntity="Course", mappedBy="nextCourse")
*/
private $prevCourse;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $redirectToUrl;
/**
* @ORM\ManyToOne(targetEntity="CourseKeyword", inversedBy="mainCourses")
*/
private $mainKeyword;
/**
* @ORM\ManyToMany(targetEntity="CourseKeyword", inversedBy="additionalCourses")
* @ORM\JoinTable(name="courses_additional_keywords")
*/
private $additionalKeywords;
/**
* @ORM\OneToOne(targetEntity="App\Entity\Gos\Uniqskills\Landing\Landing", mappedBy="course")
*/
private $newLandingPage;
/**
* @ORM\ManyToMany(targetEntity="Course")
* @ORM\JoinTable(name="course_suggested")
*/
private $course;
/**
* @ORM\OneToMany(targetEntity="Module", mappedBy="course")
*/
private $module;
/**
* @ORM\OneToMany(targetEntity="Package", mappedBy="course")
*/
private $package;
/**
* @ORM\ManyToOne(targetEntity="CourseType",)
* @ORM\JoinColumn()
*/
private $courseType;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Gos\Category", inversedBy="courses")
* @ORM\JoinColumn()
*/
private $category;
/**
* @ORM\ManyToMany(targetEntity="App\Entity\Gos\Category", inversedBy="additionalCourses")
* @ORM\JoinTable(name="courses_additional_categories")
*/
private $additionalCategories;
/**
* @ORM\OneToMany(targetEntity="Test", mappedBy="course")
*/
private $test;
/**
* @ORM\ManyToOne(targetEntity="Cooperator", inversedBy="course")
* @ORM\JoinColumn()
*/
private $cooperator;
/**
* @ORM\OneToMany(targetEntity="App\Entity\Gos\StaticPage", mappedBy="course")
*/
private $staticPage;
/**
* @ORM\OneToMany(targetEntity="App\Entity\Gos\Uniqskills\OrderError", mappedBy="course")
*/
private $ordersError;
/**
* @ORM\ManyToMany(targetEntity="Author")
* @ORM\JoinTable(name="course_author",
* joinColumns={@ORM\JoinColumn(name="course_id", referencedColumnName="id")},
* inverseJoinColumns={@ORM\JoinColumn(name="author_id", referencedColumnName="id")}
* )
*/
private $authors;
/**
* @ORM\ManyToMany(targetEntity="App\Entity\Gos\Uniqskills\Testimonial")
* @ORM\JoinTable(name="course_testimonial",
* joinColumns={@ORM\JoinColumn(name="course_id", referencedColumnName="id")},
* inverseJoinColumns={@ORM\JoinColumn(name="testimonial_id", referencedColumnName="id")}
* )
*/
private $testimonials;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Gos\PortalSettings", inversedBy="course")
* @ORM\JoinColumn()
*/
private $portalSettings;
/**
* @ORM\OneToOne(targetEntity="App\Entity\Gos\Uniqskills\Voucher", mappedBy="course")
*/
private $voucher;
/**
* @ORM\ManyToMany(targetEntity="App\Entity\Gos\ProductVariant", mappedBy="courses")
*/
private $productVariants;
/**
* @ORM\OneToMany(targetEntity="App\Entity\Gos\Uniqskills\Certificate", mappedBy="course")
*/
private $certificates;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private $catalogPosition;
/**
* @ORM\OneToOne(targetEntity="App\Entity\Gos\Uniqskills\Course", mappedBy="originalCourse")
*/
private $virtualCourse;
/**
* @ORM\OneToOne(targetEntity="App\Entity\Gos\Uniqskills\Course", inversedBy="virtualCourse")
*/
private $originalCourse;
/**
* @ORM\ManyToMany(targetEntity="App\Entity\Gos\NotificationForUser", mappedBy="courses")
*/
private $notificationForUsers;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private $durationWeeks;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $durationPerWeek;
/**
* @ORM\Column(type="boolean", options={"default":0})
*/
private $hasMedicalContent = 0;
/**
* @ORM\OneToMany(targetEntity=CourseNotify::class, mappedBy="course")
*/
private $courseNotifies;
/** @ORM\PrePersist() */
public function prePersist()
{
$this->createdAt = new \DateTime();
}
/** @ORM\PreUpdate() */
public function preUpdate()
{
$this->updatedAt = new \DateTime();
}
public function __toString()
{
return (string)$this->name;
}
/**
* If manually uploading a file (i.e. not using Symfony Form) ensure an instance
* of 'UploadedFile' is injected into this setter to trigger the update. If this
* bundle's configuration parameter 'inject_on_load' is set to 'true' this setter
* must be able to accept an instance of 'File' as the bundle will inject one here
* during Doctrine hydration.
*
* @param File|\Symfony\Component\HttpFoundation\File\UploadedFile $image
*
* @return Course
*/
public function setImageFile(File $image = null)
{
$this->imageFile = $image;
if ($image)
{
// It is required that at least one field changes if you are using doctrine
// otherwise the event listeners won't be called and the file is lost
$this->updatedAt = new \DateTimeImmutable();
}
return $this;
}
/**
* @return File|null
*/
public function getImageFile()
{
return $this->imageFile;
}
/**
* @param string $imageName
*
* @return Course
*/
public function setImageName($imageName)
{
$this->imageName = $imageName;
return $this;
}
/**
* @return string|null
*/
public function getImageName()
{
return $this->imageName;
}
/**
* If manually uploading a file (i.e. not using Symfony Form) ensure an instance
* of 'UploadedFile' is injected into this setter to trigger the update. If this
* bundle's configuration parameter 'inject_on_load' is set to 'true' this setter
* must be able to accept an instance of 'File' as the bundle will inject one here
* during Doctrine hydration.
*
* @param File|\Symfony\Component\HttpFoundation\File\UploadedFile $adImage
*
* @return Course
*/
public function setAdImageFile(File $adImage = null)
{
$this->adImageFile = $adImage;
if ($adImage)
{
// It is required that at least one field changes if you are using doctrine
// otherwise the event listeners won't be called and the file is lost
$this->updatedAt = new \DateTimeImmutable();
}
return $this;
}
/**
* @return File|null
*/
public function getAdImageFile()
{
return $this->adImageFile;
}
/**
* @param string $adImageName
*
* @return Course
*/
public function setAdImageName($adImageName)
{
$this->adImageName = $adImageName;
return $this;
}
/**
* @return string|null
*/
public function getAdImageName()
{
return $this->adImageName;
}
/**
* If manually uploading a file (i.e. not using Symfony Form) ensure an instance
* of 'UploadedFile' is injected into this setter to trigger the update. If this
* bundle's configuration parameter 'inject_on_load' is set to 'true' this setter
* must be able to accept an instance of 'File' as the bundle will inject one here
* during Doctrine hydration.
*
* @param File|\Symfony\Component\HttpFoundation\File\UploadedFile $image
*
* @return Course
*/
public function setModuleBackgroundImageFile(File $image = null)
{
$this->moduleBackgroundImageFile = $image;
if ($image)
{
// It is required that at least one field changes if you are using doctrine
// otherwise the event listeners won't be called and the file is lost
$this->updatedAt = new \DateTimeImmutable();
}
return $this;
}
/**
* @return File|null
*/
public function getModuleBackgroundImageFile()
{
return $this->moduleBackgroundImageFile;
}
/**
* @param string $moduleBackgroundImageName
*
* @return Course
*/
public function setModuleBackgroundImageName($moduleBackgroundImageName)
{
$this->moduleBackgroundImageName = $moduleBackgroundImageName;
return $this;
}
/**
* @return string|null
*/
public function getModuleBackgroundImageName()
{
return $this->moduleBackgroundImageName;
}
/**
* Constructor
*/
public function __construct()
{
$this->discountCode = new \Doctrine\Common\Collections\ArrayCollection();
$this->module = new \Doctrine\Common\Collections\ArrayCollection();
$this->package = new \Doctrine\Common\Collections\ArrayCollection();
$this->staticPage = new \Doctrine\Common\Collections\ArrayCollection();
$this->orders = new \Doctrine\Common\Collections\ArrayCollection();
$this->files = new \Doctrine\Common\Collections\ArrayCollection();
$this->authors = new \Doctrine\Common\Collections\ArrayCollection();
$this->additionalCategories = new \Doctrine\Common\Collections\ArrayCollection();
$this->additionalKeywords = new \Doctrine\Common\Collections\ArrayCollection();
$this->prevCourse = new ArrayCollection();
$this->course = new ArrayCollection();
$this->productVariant = new ArrayCollection();
$this->test = new ArrayCollection();
$this->testimonials = new ArrayCollection();
$this->ordersError = new ArrayCollection();
$this->productVariants = new ArrayCollection();
$this->certificates = new ArrayCollection();
$this->notificationForUsers = new ArrayCollection();
$this->courseNotifies = new ArrayCollection();
}
public function __clone()
{
$this->id = null;
$this->updatedAt = null;
}
public function getAllKeywords()
{
return new \Doctrine\Common\Collections\ArrayCollection(
array_merge(
$this->getAdditionalKeywords()->toArray(),
array($this->getMainKeyword())
)
);
}
public function clearModule()
{
$this->module = null;
}
public function clearNewLandingPage()
{
$this->newLandingPage = null;
}
/* ****************************** GETTERS & SETTERS ****************************** */
public function getId(): ?int
{
return $this->id;
}
public function getIsActive(): ?bool
{
return $this->isActive;
}
public function setIsActive(?bool $isActive): self
{
$this->isActive = $isActive;
return $this;
}
public function getIsPremium(): ?bool
{
return $this->isPremium;
}
public function setIsPremium(bool $isPremium): self
{
$this->isPremium = $isPremium;
return $this;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(string $name): self
{
$this->name = $name;
return $this;
}
public function getShortBody(): ?string
{
return $this->shortBody;
}
public function setShortBody(string $shortBody): self
{
$this->shortBody = $shortBody;
return $this;
}
public function getSlug(): ?string
{
return $this->slug;
}
public function setSlug($slug): self
{
$this->slug = $slug;
return $this;
}
public function getDefaultPrice(): ?float
{
return $this->defaultPrice;
}
public function setDefaultPrice(float $defaultPrice): self
{
$this->defaultPrice = $defaultPrice;
return $this;
}
public function getDurationHours(): ?int
{
return $this->durationHours;
}
public function setDurationHours(int $durationHours): self
{
$this->durationHours = $durationHours;
return $this;
}
public function getDurationMonths(): ?int
{
return $this->durationMonths;
}
public function setDurationMonths(int $durationMonths): self
{
$this->durationMonths = $durationMonths;
return $this;
}
public function getInscriptions(): ?bool
{
return $this->inscriptions;
}
public function setInscriptions(bool $inscriptions): self
{
$this->inscriptions = $inscriptions;
return $this;
}
public function getProductForCos(): ?string
{
return $this->productForCos;
}
public function setProductForCos(?string $productForCos): self
{
$this->productForCos = $productForCos;
return $this;
}
public function getFilepath(): ?string
{
return $this->filepath;
}
public function setFilepath(?string $filepath): self
{
$this->filepath = $filepath;
return $this;
}
public function getIsContinuous(): ?bool
{
return $this->isContinuous;
}
public function setIsContinuous(bool $isContinuous): self
{
$this->isContinuous = $isContinuous;
return $this;
}
public function getShareDate(): ?\DateTimeInterface
{
return $this->shareDate;
}
public function setShareDate(?\DateTimeInterface $shareDate): self
{
$this->shareDate = $shareDate;
return $this;
}
public function getMetaTitle(): ?string
{
return $this->metaTitle;
}
public function setMetaTitle(?string $metaTitle): self
{
$this->metaTitle = $metaTitle;
return $this;
}
public function getMetaDescription(): ?string
{
return $this->metaDescription;
}
public function setMetaDescription(?string $metaDescription): self
{
$this->metaDescription = $metaDescription;
return $this;
}
public function getLandingPage(): ?bool
{
return $this->landingPage;
}
public function setLandingPage(?bool $landingPage): self
{
$this->landingPage = $landingPage;
return $this;
}
public function getActionNumber(): ?string
{
return $this->actionNumber;
}
public function setActionNumber(?string $actionNumber): self
{
$this->actionNumber = $actionNumber;
return $this;
}
public function getFromSource(): ?string
{
return $this->fromSource;
}
public function setFromSource(?string $fromSource): self
{
$this->fromSource = $fromSource;
return $this;
}
public function getCreatedAt(): ?\DateTimeInterface
{
return $this->createdAt;
}
public function setCreatedAt(\DateTimeInterface $createdAt): self
{
$this->createdAt = $createdAt;
return $this;
}
public function getUpdatedAt(): ?\DateTimeInterface
{
return $this->updatedAt;
}
public function setUpdatedAt(?\DateTimeInterface $updatedAt): self
{
$this->updatedAt = $updatedAt;
return $this;
}
public function getHideAfter(): ?\DateTimeInterface
{
return $this->hideAfter;
}
public function setHideAfter(?\DateTimeInterface $hideAfter): self
{
$this->hideAfter = $hideAfter;
return $this;
}
public function getStartDate(): ?\DateTimeInterface
{
return $this->startDate;
}
public function setStartDate(?\DateTimeInterface $startDate): self
{
$this->startDate = $startDate;
return $this;
}
public function getAdStartDate(): ?\DateTimeInterface
{
return $this->adStartDate;
}
public function setAdStartDate(?\DateTimeInterface $adStartDate): self
{
$this->adStartDate = $adStartDate;
return $this;
}
public function getAdEndDate(): ?\DateTimeInterface
{
return $this->adEndDate;
}
public function setAdEndDate(?\DateTimeInterface $adEndDate): self
{
$this->adEndDate = $adEndDate;
return $this;
}
public function getAllLessonsAccess(): ?bool
{
return $this->allLessonsAccess;
}
public function setAllLessonsAccess(bool $allLessonsAccess): self
{
$this->allLessonsAccess = $allLessonsAccess;
return $this;
}
public function getIsNoIndex(): ?bool
{
return $this->isNoIndex;
}
public function setIsNoIndex(bool $isNoIndex): self
{
$this->isNoIndex = $isNoIndex;
return $this;
}
public function getIsOrbicoAgreement(): ?bool
{
return $this->isOrbicoAgreement;
}
public function setIsOrbicoAgreement(bool $isOrbicoAgreement): self
{
$this->isOrbicoAgreement = $isOrbicoAgreement;
return $this;
}
public function getIsPartnerAgreement(): ?bool
{
return $this->isPartnerAgreement;
}
public function setIsPartnerAgreement(bool $isPartnerAgreement): self
{
$this->isPartnerAgreement = $isPartnerAgreement;
return $this;
}
public function getNextCourse(): ?self
{
return $this->nextCourse;
}
public function setNextCourse(?self $nextCourse): self
{
$this->nextCourse = $nextCourse;
return $this;
}
/**
* @return Collection|Course[]
*/
public function getPrevCourse(): Collection
{
return $this->prevCourse;
}
public function addPrevCourse(Course $prevCourse): self
{
if (!$this->prevCourse->contains($prevCourse)) {
$this->prevCourse[] = $prevCourse;
$prevCourse->setNextCourse($this);
}
return $this;
}
public function removePrevCourse(Course $prevCourse): self
{
if ($this->prevCourse->contains($prevCourse)) {
$this->prevCourse->removeElement($prevCourse);
// set the owning side to null (unless already changed)
if ($prevCourse->getNextCourse() === $this) {
$prevCourse->setNextCourse(null);
}
}
return $this;
}
public function getMainKeyword(): ?CourseKeyword
{
return $this->mainKeyword;
}
public function setMainKeyword(?CourseKeyword $mainKeyword): self
{
$this->mainKeyword = $mainKeyword;
return $this;
}
/**
* @return Collection|CourseKeyword[]
*/
public function getAdditionalKeywords(): Collection
{
return $this->additionalKeywords;
}
public function addAdditionalKeyword(CourseKeyword $additionalKeyword): self
{
if (!$this->additionalKeywords->contains($additionalKeyword)) {
$this->additionalKeywords[] = $additionalKeyword;
}
return $this;
}
public function removeAdditionalKeyword(CourseKeyword $additionalKeyword): self
{
if ($this->additionalKeywords->contains($additionalKeyword)) {
$this->additionalKeywords->removeElement($additionalKeyword);
}
return $this;
}
public function getNewLandingPage(): ?Landing
{
return $this->newLandingPage;
}
public function setNewLandingPage(?Landing $newLandingPage): self
{
$this->newLandingPage = $newLandingPage;
// set (or unset) the owning side of the relation if necessary
$newCourse = $newLandingPage === null ? null : $this;
if ($newCourse !== $newLandingPage->getCourse()) {
$newLandingPage->setCourse($newCourse);
}
return $this;
}
/**
* @return Collection|Course[]
*/
public function getCourse(): Collection
{
return $this->course;
}
public function addCourse(Course $course): self
{
if (!$this->course->contains($course)) {
$this->course[] = $course;
}
return $this;
}
public function removeCourse(Course $course): self
{
if ($this->course->contains($course)) {
$this->course->removeElement($course);
}
return $this;
}
/**
* @return Collection|Module[]
*/
public function getModule(): Collection
{
return $this->module;
}
public function addModule(Module $module): self
{
if (!$this->module->contains($module)) {
$this->module[] = $module;
$module->setCourse($this);
}
return $this;
}
public function removeModule(Module $module): self
{
if ($this->module->contains($module)) {
$this->module->removeElement($module);
// set the owning side to null (unless already changed)
if ($module->getCourse() === $this) {
$module->setCourse(null);
}
}
return $this;
}
/**
* @return Collection|Package[]
*/
public function getPackage(): Collection
{
return $this->package;
}
public function addPackage(Package $package): self
{
if (!$this->package->contains($package)) {
$this->package[] = $package;
$package->setCourse($this);
}
return $this;
}
public function removePackage(Package $package): self
{
if ($this->package->contains($package)) {
$this->package->removeElement($package);
// set the owning side to null (unless already changed)
if ($package->getCourse() === $this) {
$package->setCourse(null);
}
}
return $this;
}
public function getCourseType(): ?CourseType
{
return $this->courseType;
}
public function setCourseType(?CourseType $courseType): self
{
$this->courseType = $courseType;
return $this;
}
/**
* @return Collection|Test[]
*/
public function getTest(): Collection
{
return $this->test;
}
public function addTest(Test $test): self
{
if (!$this->test->contains($test)) {
$this->test[] = $test;
$test->setCourse($this);
}
return $this;
}
public function removeTest(Test $test): self
{
if ($this->test->contains($test)) {
$this->test->removeElement($test);
// set the owning side to null (unless already changed)
if ($test->getCourse() === $this) {
$test->setCourse(null);
}
}
return $this;
}
public function getVoucher(): ?Voucher
{
return $this->voucher;
}
public function setVoucher(?Voucher $voucher): self
{
$this->voucher = $voucher;
// set (or unset) the owning side of the relation if necessary
$newCourse = $voucher === null ? null : $this;
if ($newCourse !== $voucher->getCourse()) {
$voucher->setCourse($newCourse);
}
return $this;
}
public function getCooperator(): ?Cooperator
{
return $this->cooperator;
}
public function setCooperator(?Cooperator $cooperator): self
{
$this->cooperator = $cooperator;
return $this;
}
public function getCategory(): ?Category
{
return $this->category;
}
public function setCategory(?Category $category): self
{
$this->category = $category;
return $this;
}
/**
* @return Collection|Category[]
*/
public function getAdditionalCategories(): Collection
{
return $this->additionalCategories;
}
public function addAdditionalCategory(Category $additionalCategory): self
{
if (!$this->additionalCategories->contains($additionalCategory)) {
$this->additionalCategories[] = $additionalCategory;
}
return $this;
}
public function removeAdditionalCategory(Category $additionalCategory): self
{
if ($this->additionalCategories->contains($additionalCategory)) {
$this->additionalCategories->removeElement($additionalCategory);
}
return $this;
}
public function getPortalSettings(): ?PortalSettings
{
return $this->portalSettings;
}
public function setPortalSettings(?PortalSettings $portalSettings): self
{
$this->portalSettings = $portalSettings;
return $this;
}
/**
* @return Collection|Author[]
*/
public function getAuthors(): Collection
{
return $this->authors;
}
public function addAuthor(Author $author): self
{
if (!$this->authors->contains($author)) {
$this->authors[] = $author;
}
return $this;
}
public function removeAuthor(Author $author): self
{
if ($this->authors->contains($author)) {
$this->authors->removeElement($author);
}
return $this;
}
/**
* @return Collection|Testimonial[]
*/
public function getTestimonials(): Collection
{
return $this->testimonials;
}
public function addTestimonial(Testimonial $testimonial): self
{
if (!$this->testimonials->contains($testimonial)) {
$this->testimonials[] = $testimonial;
}
return $this;
}
public function removeTestimonial(Testimonial $testimonial): self
{
if ($this->testimonials->contains($testimonial)) {
$this->testimonials->removeElement($testimonial);
}
return $this;
}
/**
* @return Collection|StaticPage[]
*/
public function getStaticPage(): Collection
{
return $this->staticPage;
}
public function addStaticPage(StaticPage $staticPage): self
{
if (!$this->staticPage->contains($staticPage)) {
$this->staticPage[] = $staticPage;
$staticPage->setCourse($this);
}
return $this;
}
public function removeStaticPage(StaticPage $staticPage): self
{
if ($this->staticPage->contains($staticPage)) {
$this->staticPage->removeElement($staticPage);
// set the owning side to null (unless already changed)
if ($staticPage->getCourse() === $this) {
$staticPage->setCourse(null);
}
}
return $this;
}
public function getRedirectToUrl(): ?string
{
return $this->redirectToUrl;
}
public function setRedirectToUrl(?string $redirectToUrl): self
{
$this->redirectToUrl = $redirectToUrl;
return $this;
}
public function getAdRedirectToUrl(): ?string
{
return $this->adRedirectToUrl;
}
public function setAdRedirectToUrl(?string $adRedirectToUrl): self
{
$this->adRedirectToUrl = $adRedirectToUrl;
return $this;
}
/**
* @return Collection|OrderError[]
*/
public function getOrdersError(): Collection
{
return $this->ordersError;
}
public function addOrdersError(OrderError $ordersError): self
{
if (!$this->ordersError->contains($ordersError)) {
$this->ordersError[] = $ordersError;
$ordersError->setCourse($this);
}
return $this;
}
public function removeOrdersError(OrderError $ordersError): self
{
if ($this->ordersError->contains($ordersError)) {
$this->ordersError->removeElement($ordersError);
// set the owning side to null (unless already changed)
if ($ordersError->getCourse() === $this) {
$ordersError->setCourse(null);
}
}
return $this;
}
public function getProductPacks(): Collection
{
$productPacks = new ArrayCollection();
foreach ($this->getProductVariants() as $productVariant)
{
foreach ($productVariant->getProductPackItem() as $productPackItem)
{
$productPacks->add($productPackItem->getProductPack());
}
}
return $productPacks;
}
/**
* @return Collection|ProductVariant[]
*/
public function getProductVariants(): Collection
{
return $this->productVariants;
}
public function addProductVariant(ProductVariant $productVariant): self
{
if (!$this->productVariants->contains($productVariant)) {
$this->productVariants[] = $productVariant;
$productVariant->addCourse($this);
}
return $this;
}
public function removeProductVariant(ProductVariant $productVariant): self
{
if ($this->productVariants->contains($productVariant)) {
$this->productVariants->removeElement($productVariant);
$productVariant->removeCourse($this);
}
return $this;
}
/**
* @return Collection|Certificate[]
*/
public function getCertificates(): Collection
{
return $this->certificates;
}
public function addCertificate(Certificate $certificate): self
{
if (!$this->certificates->contains($certificate)) {
$this->certificates[] = $certificate;
$certificate->setCourse($this);
}
return $this;
}
public function removeCertificate(Certificate $certificate): self
{
if ($this->certificates->contains($certificate)) {
$this->certificates->removeElement($certificate);
// set the owning side to null (unless already changed)
if ($certificate->getCourse() === $this) {
$certificate->setCourse(null);
}
}
return $this;
}
public function getCatalogPosition(): ?int
{
return $this->catalogPosition;
}
public function setCatalogPosition(?int $catalogPosition): self
{
$this->catalogPosition = $catalogPosition;
return $this;
}
public function getVirtualCourse(): ?Course
{
return $this->virtualCourse;
}
public function setVirtualCourse(?Course $virtualCourse): self
{
$this->virtualCourse = $virtualCourse;
return $this;
}
public function getOriginalCourse(): ?Course
{
return $this->originalCourse;
}
public function setOriginalCourse(?Course $originalCourse): self
{
$this->originalCourse = $originalCourse;
return $this;
}
public function getIsOnlineConference(): bool
{
return $this->isOnlineConference;
}
public function setIsOnlineConference(bool $isOnlineConference): self
{
$this->isOnlineConference = $isOnlineConference;
return $this;
}
/**
* @return Collection|Course[]
*/
public function getNotificationForUsers(): Collection
{
return $this->notificationForUsers;
}
public function addNotificationForUsers(NotificationForUser $notificationForUser): self
{
if (!$this->notificationForUsers->contains($notificationForUser)) {
$this->notificationForUsers[] = $notificationForUser;
$notificationForUser->addCourses($this);
}
return $this;
}
public function removeNotificationForUsers(NotificationForUser $notificationForUser): self
{
if ($this->notificationForUsers->contains($notificationForUser)) {
$this->notificationForUsers->removeElement($notificationForUser);
$notificationForUser->removeCourses($this);
}
return $this;
}
public function getDurationWeeks(): ?int
{
return $this->durationWeeks;
}
public function setDurationWeeks(?int $durationWeeks): self
{
$this->durationWeeks = $durationWeeks;
return $this;
}
public function getDurationPerWeek(): ?string
{
return $this->durationPerWeek;
}
public function setDurationPerWeek(?string $durationPerWeek): self
{
$this->durationPerWeek = $durationPerWeek;
return $this;
}
public function getHasMedicalContent(): ?bool
{
return $this->hasMedicalContent;
}
public function setHasMedicalContent(bool $hasMedicalContent): self
{
$this->hasMedicalContent = $hasMedicalContent;
return $this;
}
public function canSendNotifciations(): bool
{
return $this->getIsContinuous() === false && $this->getShareDate() > new \DateTime();
}
/**
* @return Collection|CourseNotify[]
*/
public function getCourseNotifies(): Collection
{
return $this->courseNotifies;
}
public function addCourseNotify(CourseNotify $courseNotify): self
{
if (!$this->courseNotifies->contains($courseNotify)) {
$this->courseNotifies[] = $courseNotify;
$courseNotify->setCourse($this);
}
return $this;
}
public function removeCourseNotify(CourseNotify $courseNotify): self
{
if ($this->courseNotifies->contains($courseNotify)) {
$this->courseNotifies->removeElement($courseNotify);
// set the owning side to null (unless already changed)
if ($courseNotify->getCourse() === $this) {
$courseNotify->setCourse(null);
}
}
return $this;
}
}