Update entities, type hint, fix associations

pull/3844/head
Julio Montoya 4 years ago
parent f368019e85
commit 093518883d
  1. 96
      src/CoreBundle/Entity/AccessUrl.php
  2. 15
      src/CoreBundle/Entity/BranchSync.php
  3. 230
      src/CoreBundle/Entity/Course.php
  4. 25
      src/CoreBundle/Entity/GradebookCategory.php
  5. 2
      src/CoreBundle/Entity/GradebookCertificate.php
  6. 2
      src/CoreBundle/Entity/GradebookEvaluation.php
  7. 2
      src/CoreBundle/Entity/GradebookLink.php
  8. 2
      src/CoreBundle/Entity/GradebookResult.php
  9. 5
      src/CoreBundle/Entity/GradebookResultAttempt.php
  10. 48
      src/CoreBundle/Entity/GradebookResultLog.php
  11. 4
      src/CoreBundle/Entity/GradebookScoreDisplay.php
  12. 2
      src/CoreBundle/Entity/GradebookScoreLog.php
  13. 27
      src/CoreBundle/Entity/Message.php
  14. 8
      src/CoreBundle/Entity/ResourceFile.php
  15. 22
      src/CoreBundle/Entity/ResourceLink.php
  16. 2
      src/CoreBundle/Entity/ResourceNode.php
  17. 2
      src/CoreBundle/Entity/SessionRelCourseRelUser.php
  18. 182
      src/CoreBundle/Entity/User.php
  19. 4
      src/CourseBundle/Entity/CCalendarEvent.php
  20. 31
      src/CourseBundle/Entity/CLinkCategory.php
  21. 8
      src/CourseBundle/Entity/CLpCategory.php
  22. 5
      src/CourseBundle/Entity/CQuiz.php
  23. 35
      src/CourseBundle/Entity/CQuizQuestion.php
  24. 30
      src/CourseBundle/Entity/CQuizRelQuestion.php
  25. 2
      src/CourseBundle/Entity/CThematicAdvance.php
  26. 7
      src/CourseBundle/Entity/CTool.php

@ -252,10 +252,8 @@ class AccessUrl extends AbstractResource implements ResourceInterface
* Set description.
*
* @param string $description
*
* @return AccessUrl
*/
public function setDescription($description)
public function setDescription($description): self
{
$this->description = $description;
@ -276,10 +274,8 @@ class AccessUrl extends AbstractResource implements ResourceInterface
* Set active.
*
* @param int $active
*
* @return AccessUrl
*/
public function setActive($active)
public function setActive($active): self
{
$this->active = $active;
@ -398,10 +394,8 @@ class AccessUrl extends AbstractResource implements ResourceInterface
/**
* @param int $limitSessions
*
* @return AccessUrl
*/
public function setLimitSessions($limitSessions)
public function setLimitSessions($limitSessions): self
{
$this->limitSessions = $limitSessions;
@ -418,10 +412,8 @@ class AccessUrl extends AbstractResource implements ResourceInterface
/**
* @param int $limitUsers
*
* @return AccessUrl
*/
public function setLimitUsers($limitUsers)
public function setLimitUsers($limitUsers): self
{
$this->limitUsers = $limitUsers;
@ -438,10 +430,8 @@ class AccessUrl extends AbstractResource implements ResourceInterface
/**
* @param int $limitTeachers
*
* @return AccessUrl
*/
public function setLimitTeachers($limitTeachers)
public function setLimitTeachers($limitTeachers): self
{
$this->limitTeachers = $limitTeachers;
@ -458,10 +448,8 @@ class AccessUrl extends AbstractResource implements ResourceInterface
/**
* @param int $limitDiskSpace
*
* @return AccessUrl
*/
public function setLimitDiskSpace($limitDiskSpace)
public function setLimitDiskSpace($limitDiskSpace): self
{
$this->limitDiskSpace = $limitDiskSpace;
@ -495,10 +483,8 @@ class AccessUrl extends AbstractResource implements ResourceInterface
/**
* @param Collection<int, SettingsCurrent>|SettingsCurrent[] $settings
*
* @return AccessUrl
*/
public function setSettings($settings)
public function setSettings($settings): self
{
$this->settings = $settings;
@ -515,10 +501,8 @@ class AccessUrl extends AbstractResource implements ResourceInterface
/**
* @param int $limitCourses
*
* @return AccessUrl
*/
public function setLimitCourses($limitCourses)
public function setLimitCourses($limitCourses): self
{
$this->limitCourses = $limitCourses;
@ -532,10 +516,8 @@ class AccessUrl extends AbstractResource implements ResourceInterface
/**
* @param AccessUrlRelCourse[]|Collection<int, AccessUrlRelCourse> $courses
*
* @return AccessUrl
*/
public function setCourses($courses)
public function setCourses($courses): self
{
$this->courses = $courses;
@ -549,10 +531,8 @@ class AccessUrl extends AbstractResource implements ResourceInterface
/**
* @param Collection<int, SessionCategory>|SessionCategory[] $sessionCategories
*
* @return AccessUrl
*/
public function setSessionCategories($sessionCategories)
public function setSessionCategories($sessionCategories): self
{
$this->sessionCategories = $sessionCategories;
@ -560,8 +540,62 @@ class AccessUrl extends AbstractResource implements ResourceInterface
}
/**
* Resource identifier.
* @return AccessUrlRelSession[]|Collection
*/
public function getSessions()
{
return $this->sessions;
}
/**
* @return AccessUrl[]|Collection
*/
public function getChildren()
{
return $this->children;
}
/**
* @return AccessUrlRelUser[]|Collection
*/
public function getUser()
{
return $this->user;
}
public function getParent(): ?self
{
return $this->parent;
}
/**
* @return AccessUrlRelCourseCategory[]|Collection
*/
public function getCourseCategory()
{
return $this->courseCategory;
}
public function getLft(): int
{
return $this->lft;
}
public function getLvl(): int
{
return $this->lvl;
}
public function getRgt(): int
{
return $this->rgt;
}
public function getRoot(): ?self
{
return $this->root;
}
public function getResourceIdentifier(): int
{
return $this->getId();

@ -7,6 +7,7 @@ declare(strict_types=1);
namespace Chamilo\CoreBundle\Entity;
use DateTime;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
@ -152,7 +153,7 @@ class BranchSync
* @ORM\OneToMany(targetEntity="BranchSync", mappedBy="parent")
* @ORM\OrderBy({"lft"="ASC"})
*
* @var BranchSync[]|\Doctrine\Common\Collections\Collection
* @var BranchSync[]|Collection
*/
protected $children;
@ -674,10 +675,8 @@ class BranchSync
/**
* @param string $description
*
* @return BranchSync
*/
public function setDescription($description)
public function setDescription($description): self
{
$this->description = $description;
@ -695,4 +694,12 @@ class BranchSync
return $this;
}
/**
* @return BranchSync[]|Collection
*/
public function getChildren()
{
return $this->children;
}
}

@ -66,7 +66,7 @@ class Course extends AbstractResource implements ResourceInterface, ResourceWith
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected int $id;
protected ?int $id = null;
/**
* The course title.
@ -97,7 +97,7 @@ class Course extends AbstractResource implements ResourceInterface, ResourceWith
protected string $code;
/**
* @var ArrayCollection|CourseRelUser[]
* @var Collection|CourseRelUser[]
*
* @ApiSubresource()
* Groups({"course:read"})
@ -110,16 +110,7 @@ class Course extends AbstractResource implements ResourceInterface, ResourceWith
protected Collection $users;
/**
* @var ArrayCollection|ResourceLink[]
*
* ApiSubresource()
* Groups({"course:read"})
* @ORM\OneToMany(targetEntity="ResourceLink", mappedBy="course", cascade={"persist"}, orphanRemoval=true)
*/
protected $resourceLinks;
/**
* @var AccessUrlRelCourse[]|ArrayCollection
* @var AccessUrlRelCourse[]|Collection
*
* @ORM\OneToMany(
* targetEntity="Chamilo\CoreBundle\Entity\AccessUrlRelCourse",
@ -129,21 +120,21 @@ class Course extends AbstractResource implements ResourceInterface, ResourceWith
protected $urls;
/**
* @var ArrayCollection|SessionRelCourse[]
* @var Collection|SessionRelCourse[]
*
* @ORM\OneToMany(targetEntity="SessionRelCourse", mappedBy="course", cascade={"persist", "remove"})
*/
protected $sessions;
/**
* @var ArrayCollection|SessionRelCourseRelUser[]
* @var Collection|SessionRelCourseRelUser[]
*
* @ORM\OneToMany(targetEntity="SessionRelCourseRelUser", mappedBy="course", cascade={"persist", "remove"})
*/
protected $sessionUserSubscriptions;
/**
* @var ArrayCollection|CTool[]
* @var Collection|CTool[]
*
* @ORM\OneToMany(targetEntity="Chamilo\CourseBundle\Entity\CTool", mappedBy="course", cascade={"persist", "remove"})
*/
@ -154,49 +145,49 @@ class Course extends AbstractResource implements ResourceInterface, ResourceWith
protected AccessUrl $currentUrl;
/**
* @var ArrayCollection|SkillRelCourse[]
* @var Collection|SkillRelCourse[]
*
* @ORM\OneToMany(targetEntity="SkillRelCourse", mappedBy="course", cascade={"persist", "remove"})
*/
protected $skills;
/**
* @var ArrayCollection|SkillRelUser[]
* @var Collection|SkillRelUser[]
*
* @ORM\OneToMany(targetEntity="SkillRelUser", mappedBy="course", cascade={"persist", "remove"})
*/
protected $issuedSkills;
/**
* @var ArrayCollection|GradebookCategory[]
* @var Collection|GradebookCategory[]
*
* @ORM\OneToMany(targetEntity="GradebookCategory", mappedBy="course", cascade={"persist", "remove"})
*/
protected $gradebookCategories;
/**
* @var ArrayCollection|GradebookEvaluation[]
* @var Collection|GradebookEvaluation[]
*
* @ORM\OneToMany(targetEntity="GradebookEvaluation", mappedBy="course", cascade={"persist", "remove"})
*/
protected $gradebookEvaluations;
/**
* @var ArrayCollection|GradebookLink[]
* @var Collection|GradebookLink[]
*
* @ORM\OneToMany(targetEntity="GradebookLink", mappedBy="course", cascade={"persist", "remove"})
*/
protected $gradebookLinks;
/**
* @var ArrayCollection|TrackEHotspot[]
* @var Collection|TrackEHotspot[]
*
* @ORM\OneToMany(targetEntity="TrackEHotspot", mappedBy="course", cascade={"persist", "remove"})
*/
protected $trackEHotspots;
/**
* @var ArrayCollection|TrackEAttempt[]
* @var Collection|TrackEAttempt[]
*
* @ORM\OneToMany(targetEntity="Chamilo\CoreBundle\Entity\TrackEAttempt", mappedBy="course", cascade={"persist", "remove"})
*/
@ -205,14 +196,14 @@ class Course extends AbstractResource implements ResourceInterface, ResourceWith
/**
* @ORM\OneToMany(targetEntity="Chamilo\CoreBundle\Entity\SearchEngineRef", mappedBy="course", cascade={"persist", "remove"})
*
* @var \Chamilo\CoreBundle\Entity\SearchEngineRef[]|\Doctrine\Common\Collections\ArrayCollection|\Doctrine\Common\Collections\Collection
* @var SearchEngineRef[]|Collection
*/
protected $searchEngineRefs;
/**
* @ORM\OneToMany(targetEntity="Chamilo\CoreBundle\Entity\Templates", mappedBy="course", cascade={"persist", "remove"})
*
* @var \Chamilo\CoreBundle\Entity\Templates[]|\Doctrine\Common\Collections\ArrayCollection|\Doctrine\Common\Collections\Collection
* @var Templates[]|Collection
*/
protected $templates;
@ -366,7 +357,7 @@ class Course extends AbstractResource implements ResourceInterface, ResourceWith
* @ORM\ManyToOne(targetEntity="Room")
* @ORM\JoinColumn(name="room_id", referencedColumnName="id")
*/
protected Room $room;
protected ?Room $room;
public function __construct()
{
@ -391,6 +382,7 @@ class Course extends AbstractResource implements ResourceInterface, ResourceWith
$this->activateLegal = 0;
$this->addTeachersToSessionsCourses = false;
$this->courseTypeId = null;
$this->room = null;
//$this->specificFieldValues = new ArrayCollection();
//$this->sharedSurveys = new ArrayCollection();
}
@ -431,14 +423,14 @@ class Course extends AbstractResource implements ResourceInterface, ResourceWith
}
/**
* @return AccessUrlRelCourse[]|ArrayCollection
* @return AccessUrlRelCourse[]|Collection
*/
public function getUrls()
{
return $this->urls;
}
public function setUrls(ArrayCollection $urls)
public function setUrls(Collection $urls)
{
$this->urls = new ArrayCollection();
foreach ($urls as $url) {
@ -467,7 +459,7 @@ class Course extends AbstractResource implements ResourceInterface, ResourceWith
}
/**
* @return ArrayCollection|CourseRelUser[]
* @return Collection|CourseRelUser[]
*/
public function getUsers()
{
@ -475,7 +467,7 @@ class Course extends AbstractResource implements ResourceInterface, ResourceWith
}
/**
* @return ArrayCollection|CourseRelUser[]
* @return Collection|CourseRelUser[]
*/
public function getTeachers()
{
@ -486,7 +478,7 @@ class Course extends AbstractResource implements ResourceInterface, ResourceWith
}
/**
* @return ArrayCollection|CourseRelUser[]
* @return Collection|CourseRelUser[]
*/
public function getStudents()
{
@ -497,7 +489,7 @@ class Course extends AbstractResource implements ResourceInterface, ResourceWith
}
/**
* @param ArrayCollection $users
* @param Collection $users
*/
public function setUsers($users)
{
@ -728,7 +720,7 @@ class Course extends AbstractResource implements ResourceInterface, ResourceWith
*
* @return Course
*/
public function setCategories(ArrayCollection $categories): self
public function setCategories(Collection $categories): self
{
$this->categories = $categories;
@ -1152,10 +1144,7 @@ class Course extends AbstractResource implements ResourceInterface, ResourceWith
return $this->courseTypeId;
}
/**
* @return Room
*/
public function getRoom()
public function getRoom(): ?Room
{
return $this->room;
}
@ -1256,7 +1245,7 @@ class Course extends AbstractResource implements ResourceInterface, ResourceWith
/**
* Get issuedSkills.
*
* @return ArrayCollection
* @return Collection
*/
public function getIssuedSkills()
{
@ -1295,6 +1284,173 @@ class Course extends AbstractResource implements ResourceInterface, ResourceWith
return $this;
}
/**
* @return SessionRelCourseRelUser[]|Collection
*/
public function getSessionUserSubscriptions()
{
return $this->sessionUserSubscriptions;
}
public function setSessionUserSubscriptions(Collection $sessionUserSubscriptions): self
{
$this->sessionUserSubscriptions = $sessionUserSubscriptions;
return $this;
}
/**
* @return SkillRelCourse[]|Collection
*/
public function getSkills()
{
return $this->skills;
}
/**
* @param SkillRelCourse[]|Collection $skills
*
* @return Course
*/
public function setSkills($skills)
{
$this->skills = $skills;
return $this;
}
/**
* @return GradebookCategory[]|Collection
*/
public function getGradebookCategories()
{
return $this->gradebookCategories;
}
/**
* @param GradebookCategory[]|Collection $gradebookCategories
*
* @return Course
*/
public function setGradebookCategories($gradebookCategories)
{
$this->gradebookCategories = $gradebookCategories;
return $this;
}
/**
* @return GradebookEvaluation[]|Collection
*/
public function getGradebookEvaluations()
{
return $this->gradebookEvaluations;
}
/**
* @param GradebookEvaluation[]|Collection $gradebookEvaluations
*
* @return Course
*/
public function setGradebookEvaluations($gradebookEvaluations)
{
$this->gradebookEvaluations = $gradebookEvaluations;
return $this;
}
/**
* @return GradebookLink[]|Collection
*/
public function getGradebookLinks()
{
return $this->gradebookLinks;
}
/**
* @param GradebookLink[]|Collection $gradebookLinks
*
* @return Course
*/
public function setGradebookLinks($gradebookLinks)
{
$this->gradebookLinks = $gradebookLinks;
return $this;
}
/**
* @return TrackEHotspot[]|Collection
*/
public function getTrackEHotspots()
{
return $this->trackEHotspots;
}
/**
* @param TrackEHotspot[]|Collection $trackEHotspots
*/
public function setTrackEHotspots($trackEHotspots): self
{
$this->trackEHotspots = $trackEHotspots;
return $this;
}
/**
* @return TrackEAttempt[]|Collection
*/
public function getTrackEAttempts()
{
return $this->trackEAttempts;
}
/**
* @param TrackEAttempt[]|Collection $trackEAttempts
*/
public function setTrackEAttempts($trackEAttempts): self
{
$this->trackEAttempts = $trackEAttempts;
return $this;
}
/**
* @return SearchEngineRef[]|Collection
*/
public function getSearchEngineRefs()
{
return $this->searchEngineRefs;
}
/**
* @param SearchEngineRef[]|Collection $searchEngineRefs
*/
public function setSearchEngineRefs($searchEngineRefs): self
{
$this->searchEngineRefs = $searchEngineRefs;
return $this;
}
/**
* @return Templates[]|Collection
*/
public function getTemplates()
{
return $this->templates;
}
/**
* @param Templates[]|Collection $templates
*/
public function setTemplates($templates): self
{
$this->templates = $templates;
return $this;
}
public function getDefaultIllustration(int $size): string
{
return '/img/icons/32/course.png';

@ -9,6 +9,7 @@ namespace Chamilo\CoreBundle\Entity;
use Chamilo\CoreBundle\Traits\CourseTrait;
use Chamilo\CoreBundle\Traits\UserTrait;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
@ -50,7 +51,7 @@ class GradebookCategory
/**
* @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\Course", inversedBy="gradebookCategories")
* @ORM\JoinColumn(name="c_id", referencedColumnName="id")
* @ORM\JoinColumn(name="c_id", referencedColumnName="id", onDelete="CASCADE")
*/
protected Course $course;
@ -62,7 +63,7 @@ class GradebookCategory
/**
* @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\Session")
* @ORM\JoinColumn(name="session_id", referencedColumnName="id")
* @ORM\JoinColumn(name="session_id", referencedColumnName="id", onDelete="CASCADE")
*/
protected ?Session $session;
@ -132,7 +133,7 @@ class GradebookCategory
protected ?int $gradeBooksToValidateInDependence;
/**
* @var ArrayCollection|GradebookComment[]
* @var Collection|GradebookComment[]
*
* @ORM\OneToMany(targetEntity="Chamilo\CoreBundle\Entity\GradebookComment", mappedBy="gradebook")
*/
@ -454,4 +455,22 @@ class GradebookCategory
return $this;
}
/**
* @return GradebookComment[]|Collection
*/
public function getComments()
{
return $this->comments;
}
/**
* @param GradebookComment[]|Collection $comments
*/
public function setComments($comments): self
{
$this->comments = $comments;
return $this;
}
}

@ -32,7 +32,7 @@ class GradebookCertificate
/**
* @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\GradebookCategory")
* @ORM\JoinColumn(name="cat_id", referencedColumnName="id")
* @ORM\JoinColumn(name="cat_id", referencedColumnName="id", onDelete="CASCADE")
*/
protected GradebookCategory $category;

@ -57,7 +57,7 @@ class GradebookEvaluation
/**
* @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\GradebookCategory")
* @ORM\JoinColumn(name="category_id", referencedColumnName="id")
* @ORM\JoinColumn(name="category_id", referencedColumnName="id", onDelete="CASCADE")
*/
protected GradebookCategory $category;

@ -60,7 +60,7 @@ class GradebookLink
/**
* @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\GradebookCategory")
* @ORM\JoinColumn(name="category_id", referencedColumnName="id")
* @ORM\JoinColumn(name="category_id", referencedColumnName="id", onDelete="CASCADE")
*/
protected GradebookCategory $category;

@ -34,7 +34,7 @@ class GradebookResult
/**
* @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\GradebookEvaluation")
* @ORM\JoinColumn(name="evaluation_id", referencedColumnName="id")
* @ORM\JoinColumn(name="evaluation_id", referencedColumnName="id", onDelete="CASCADE")
*/
protected GradebookEvaluation $evaluation;

@ -37,7 +37,8 @@ class GradebookResultAttempt
protected ?float $score;
/**
* @ORM\Column(name="result_id", type="integer", nullable=false)
* @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\GradebookResult")
* @ORM\JoinColumn(name="result_id", referencedColumnName="id", onDelete="CASCADE")
*/
protected int $resultId;
protected GradebookResult $result;
}

@ -24,19 +24,21 @@ class GradebookResultLog
/**
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="IDENTITY")
* @ORM\GeneratedValue()
*/
protected int $id;
/**
* @ORM\Column(name="result_id", type="integer", nullable=false)
* @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\GradebookResult")
* @ORM\JoinColumn(name="result_id", referencedColumnName="id", onDelete="CASCADE")
*/
protected int $resultId;
protected GradebookResult $result;
/**
* @ORM\Column(name="evaluation_id", type="integer", nullable=false)
* @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\GradebookEvaluation")
* @ORM\JoinColumn(name="evaluation_id", referencedColumnName="id", onDelete="CASCADE")
*/
protected int $evaluationId;
protected GradebookEvaluation $evaluation;
/**
* @Gedmo\Timestampable(on="create")
@ -55,30 +57,6 @@ class GradebookResultLog
*/
protected User $user;
/**
* Set evaluationId.
*
* @param int $evaluationId
*
* @return GradebookResultLog
*/
public function setEvaluationId($evaluationId)
{
$this->evaluationId = $evaluationId;
return $this;
}
/**
* Get evaluationId.
*
* @return int
*/
public function getEvaluationId()
{
return $this->evaluationId;
}
/**
* Set createdAt.
*
@ -136,16 +114,4 @@ class GradebookResultLog
{
return $this->id;
}
public function getResultId(): int
{
return $this->resultId;
}
public function setResultId(int $resultId): self
{
$this->resultId = $resultId;
return $this;
}
}

@ -21,7 +21,7 @@ class GradebookScoreDisplay
/**
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="IDENTITY")
* @ORM\GeneratedValue()
*/
protected int $id;
@ -37,7 +37,7 @@ class GradebookScoreDisplay
/**
* @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\GradebookCategory")
* @ORM\JoinColumn(name="category_id", referencedColumnName="id")
* @ORM\JoinColumn(name="category_id", referencedColumnName="id", onDelete="CASCADE")
*/
protected GradebookCategory $category;

@ -34,7 +34,7 @@ class GradebookScoreLog
/**
* @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\GradebookCategory")
* @ORM\JoinColumn(name="category_id", referencedColumnName="id")
* @ORM\JoinColumn(name="category_id", referencedColumnName="id", onDelete="CASCADE")
*/
protected GradebookCategory $category;

@ -8,6 +8,7 @@ namespace Chamilo\CoreBundle\Entity;
use DateTime;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
@ -75,16 +76,16 @@ class Message
protected int $groupId;
/**
* @var ArrayCollection|Message[]
* @var Collection|Message[]
* @ORM\OneToMany(targetEntity="Message", mappedBy="parent")
*/
protected $children;
protected Collection $children;
/**
* @ORM\ManyToOne(targetEntity="Message", inversedBy="children")
* @ORM\JoinColumn(name="parent_id", referencedColumnName="id")
*/
protected ?Message $parent;
protected ?Message $parent = null;
/**
* @ORM\Column(name="update_date", type="datetime", nullable=true)
@ -97,18 +98,18 @@ class Message
protected ?int $votes;
/**
* @var ArrayCollection|MessageAttachment[]
* @var Collection|MessageAttachment[]
*
* @ORM\OneToMany(targetEntity="MessageAttachment", mappedBy="message")
*/
protected $attachments;
protected Collection $attachments;
/**
* @var ArrayCollection|MessageFeedback[]
* @var Collection|MessageFeedback[]
*
* @ORM\OneToMany(targetEntity="MessageFeedback", mappedBy="message", orphanRemoval=true)
*/
protected $likes;
protected Collection $likes;
public function __construct()
{
@ -328,13 +329,13 @@ class Message
return $this;
}
public function getParent(): self
public function getParent(): ?self
{
return $this->parent;
}
/**
* @return ArrayCollection|Message[]
* @return Collection|Message[]
*/
public function getChildren()
{
@ -356,6 +357,14 @@ class Message
return $this;
}
/**
* @return MessageFeedback[]|Collection
*/
public function getLikes()
{
return $this->likes;
}
/**
* Get an excerpt from the content.
*

@ -79,7 +79,7 @@ class ResourceFile
* @ORM\Column(type="integer")
* @ORM\GeneratedValue
*/
protected int $id;
protected ?int $id = null;
/**
* @Assert\NotBlank()
@ -87,7 +87,7 @@ class ResourceFile
*
* @ORM\Column(type="string", length=255)
*/
protected string $name;
protected ?string $name;
/**
* @Groups({"resource_file:read", "resource_node:read", "document:read"})
@ -112,7 +112,7 @@ class ResourceFile
*
* @ORM\Column(type="integer")
*/
protected int $size;
protected ?int $size = 0;
/**
* @Assert\NotNull()
@ -125,7 +125,7 @@ class ResourceFile
* dimensions="dimensions"
* )
*/
protected File $file;
protected ?File $file;
/**
* @ORM\Column(name="crop", type="string", length=255, nullable=true)

@ -32,29 +32,29 @@ class ResourceLink
* @ORM\Column(type="integer")
* @ORM\GeneratedValue
*/
protected int $id;
protected ?int $id = null;
/**
* @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\ResourceNode", inversedBy="resourceLinks")
* @ORM\JoinColumn(name="resource_node_id", referencedColumnName="id", onDelete="SET NULL")
* @ORM\JoinColumn(name="resource_node_id", referencedColumnName="id", onDelete="CASCADE")
*/
protected ResourceNode $resourceNode;
/**
* @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\Course", inversedBy="resourceLinks")
* @ORM\JoinColumn(name="c_id", referencedColumnName="id", nullable=true)
* @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\Course")
* @ORM\JoinColumn(name="c_id", referencedColumnName="id", nullable=true, onDelete="CASCADE")
*/
protected ?Course $course;
protected ?Course $course = null;
/**
* @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\Session", inversedBy="resourceLinks")
* @ORM\JoinColumn(name="session_id", referencedColumnName="id", nullable=true)
* @ORM\JoinColumn(name="session_id", referencedColumnName="id", nullable=true, onDelete="CASCADE")
*/
protected ?Session $session;
protected ?Session $session = null;
/**
* @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\User")
* @ORM\JoinColumn(name="user_id", referencedColumnName="id", nullable=true)
* @ORM\JoinColumn(name="user_id", referencedColumnName="id", nullable=true, onDelete="SET NULL")
*/
protected ?User $user = null;
@ -62,13 +62,13 @@ class ResourceLink
* @ORM\ManyToOne(targetEntity="Chamilo\CourseBundle\Entity\CGroup")
* @ORM\JoinColumn(name="group_id", referencedColumnName="iid", nullable=true, onDelete="CASCADE")
*/
protected ?CGroup $group;
protected ?CGroup $group = null;
/**
* @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\Usergroup")
* @ORM\JoinColumn(name="usergroup_id", referencedColumnName="id", nullable=true)
* @ORM\JoinColumn(name="usergroup_id", referencedColumnName="id", nullable=true, onDelete="CASCADE")
*/
protected ?Usergroup $userGroup;
protected ?Usergroup $userGroup = null;
/**
* @ORM\OneToMany(

@ -59,7 +59,7 @@ class ResourceNode
* @ORM\Column(type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected int $id;
protected ?int $id = null;
/**
* @Assert\NotBlank()

@ -64,7 +64,7 @@ class SessionRelCourseRelUser
/**
* @Groups({"session_rel_course_rel_user:read"})
* @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\Course", inversedBy="sessionUserSubscriptions", cascade={"persist"})
* @ORM\JoinColumn(name="c_id", referencedColumnName="id", nullable=false)
* @ORM\JoinColumn(name="c_id", referencedColumnName="id", nullable=false, onDelete="CASCADE")
*/
protected Course $course;

@ -574,7 +574,7 @@ class User implements UserInterface, EquatableInterface, ResourceInterface, Reso
* orphanRemoval=true
* )
*/
protected Collection $sessions;
protected Collection $sessionsRelUser;
/**
* @var CGroupRelUser[]|Collection<int, CGroupRelUser>
@ -758,7 +758,7 @@ class User implements UserInterface, EquatableInterface, ResourceInterface, Reso
$this->userRelCourseVotes = new ArrayCollection();
$this->userRelTags = new ArrayCollection();
$this->personalAgendas = new ArrayCollection();
$this->sessions = new ArrayCollection();
$this->sessionsRelUser = new ArrayCollection();
$this->sentMessages = new ArrayCollection();
$this->receivedMessages = new ArrayCollection();
@ -851,7 +851,7 @@ class User implements UserInterface, EquatableInterface, ResourceInterface, Reso
return $this;
}
public function getResourceNode(): ResourceNode
public function getResourceNode(): ?ResourceNode
{
return $this->resourceNode;
}
@ -1969,6 +1969,174 @@ class User implements UserInterface, EquatableInterface, ResourceInterface, Reso
return $this->hasRole('ROLE_ADMIN');
}
/**
* @return GradebookCategory[]|Collection
*/
public function getGradeBookCategories()
{
return $this->gradeBookCategories;
}
/**
* @return GradebookComment[]|Collection
*/
public function getGradeBookComments()
{
return $this->gradeBookComments;
}
/**
* @return GradebookEvaluation[]|Collection
*/
public function getGradeBookEvaluations()
{
return $this->gradeBookEvaluations;
}
/**
* @return GradebookLink[]|Collection
*/
public function getGradeBookLinks()
{
return $this->gradeBookLinks;
}
/**
* @return GradebookResult[]|Collection
*/
public function getGradeBookResults()
{
return $this->gradeBookResults;
}
/**
* @return GradebookResultLog[]|Collection
*/
public function getGradeBookResultLogs()
{
return $this->gradeBookResultLogs;
}
/**
* @return GradebookScoreLog[]|Collection
*/
public function getGradeBookScoreLogs()
{
return $this->gradeBookScoreLogs;
}
/**
* @return GradebookLinkevalLog[]|Collection
*/
public function getGradeBookLinkEvalLogs()
{
return $this->gradeBookLinkEvalLogs;
}
/**
* @return UserRelCourseVote[]|Collection
*/
public function getUserRelCourseVotes()
{
return $this->userRelCourseVotes;
}
/**
* @return UserRelTag[]|Collection
*/
public function getUserRelTags()
{
return $this->userRelTags;
}
/**
* @return PersonalAgenda[]|Collection
*/
public function getPersonalAgendas()
{
return $this->personalAgendas;
}
/**
* @return Collection|mixed[]
*/
public function getCurriculumItems()
{
return $this->curriculumItems;
}
/**
* @return UserRelUser[]|Collection
*/
public function getUserRelUsers()
{
return $this->userRelUsers;
}
/**
* @return Templates[]|Collection
*/
public function getTemplates()
{
return $this->templates;
}
/**
* @return ArrayCollection|Collection
*/
public function getDropBoxReceivedFiles()
{
return $this->dropBoxReceivedFiles;
}
/**
* @return SequenceValue[]|Collection
*/
public function getSequenceValues()
{
return $this->sequenceValues;
}
/**
* @return TrackEExerciseConfirmation[]|Collection
*/
public function getTrackEExerciseConfirmations()
{
return $this->trackEExerciseConfirmations;
}
/**
* @return TrackEAttempt[]|Collection
*/
public function getTrackEAccessCompleteList()
{
return $this->trackEAccessCompleteList;
}
/**
* @return TrackEAttempt[]|Collection
*/
public function getTrackEAttempts()
{
return $this->trackEAttempts;
}
/**
* @return TrackECourseAccess[]|Collection
*/
public function getTrackECourseAccess()
{
return $this->trackECourseAccess;
}
/**
* @return UserCourseCategory[]|Collection
*/
public function getUserCourseCategories()
{
return $this->userCourseCategories;
}
public function getCourseGroupsAsTutorFromCourse(Course $course): Collection
{
$criteria = Criteria::create();
@ -1989,6 +2157,14 @@ class User implements UserInterface, EquatableInterface, ResourceInterface, Reso
return $this->getSessions(0);
}
/**
* @return SessionRelUser[]|Collection
*/
public function getSessionsRelUser()
{
return $this->sessionsRelUser;
}
/**
* Retreives this user's related sessions.
*

@ -64,7 +64,7 @@ class CCalendarEvent extends AbstractResource implements ResourceInterface
* @ORM\ManyToOne(targetEntity="Chamilo\CourseBundle\Entity\CCalendarEvent", inversedBy="children")
* @ORM\JoinColumn(name="parent_event_id", referencedColumnName="iid")
*/
protected ?CCalendarEvent $parentEvent;
protected ?CCalendarEvent $parentEvent = null;
/**
* @var ArrayCollection|CCalendarEventRepeat[]
@ -92,7 +92,7 @@ class CCalendarEvent extends AbstractResource implements ResourceInterface
* @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\Room")
* @ORM\JoinColumn(name="room_id", referencedColumnName="id")
*/
protected Room $room;
protected ?Room $room = null;
/**
* @var ArrayCollection|CCalendarEventAttachment[]

@ -72,14 +72,7 @@ class CLinkCategory extends AbstractResource implements ResourceInterface
return $this->iid;
}
/**
* Set categoryTitle.
*
* @param string $categoryTitle
*
* @return CLinkCategory
*/
public function setCategoryTitle($categoryTitle)
public function setCategoryTitle(string $categoryTitle): self
{
$this->categoryTitle = $categoryTitle;
@ -103,28 +96,24 @@ class CLinkCategory extends AbstractResource implements ResourceInterface
return $this->description;
}
/**
* Set displayOrder.
*
* @param int $displayOrder
*
* @return CLinkCategory
*/
public function setDisplayOrder($displayOrder)
public function setDisplayOrder(int $displayOrder): self
{
$this->displayOrder = $displayOrder;
return $this;
}
public function getDisplayOrder(): int
{
return $this->displayOrder;
}
/**
* Get displayOrder.
*
* @return int
* @return CLink[]|Collection
*/
public function getDisplayOrder()
public function getLinks()
{
return $this->displayOrder;
return $this->links;
}
public function getResourceIdentifier(): int

@ -46,7 +46,7 @@ class CLpCategory extends AbstractResource implements ResourceInterface
protected int $position;
/**
* @var ArrayCollection|CLpCategoryUser
* @var Collection|CLpCategoryUser
*
* @ORM\OneToMany(
* targetEntity="Chamilo\CourseBundle\Entity\CLpCategoryUser",
@ -111,7 +111,7 @@ class CLpCategory extends AbstractResource implements ResourceInterface
}
/**
* @return ArrayCollection|CLp[]
* @return Collection|CLp[]
*/
public function getLps()
{
@ -119,7 +119,7 @@ class CLpCategory extends AbstractResource implements ResourceInterface
}
/**
* @return ArrayCollection
* @return Collection
*/
public function getUsers()
{
@ -127,7 +127,7 @@ class CLpCategory extends AbstractResource implements ResourceInterface
}
/**
* @param ArrayCollection $users
* @param Collection $users
*/
public function setUsers($users): void
{

@ -12,6 +12,7 @@ use Chamilo\CoreBundle\Entity\ResourceInterface;
use Chamilo\CourseBundle\Traits\ShowCourseResourcesInSessionTrait;
use DateTime;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Event\LifecycleEventArgs;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
@ -199,7 +200,7 @@ class CQuiz extends AbstractResource implements ResourceInterface
protected ?array $pageResultConfiguration;
/**
* @var ArrayCollection|CQuizRelQuestion[]
* @var Collection|CQuizRelQuestion[]
*
* @ORM\OneToMany(targetEntity="CQuizRelQuestion", mappedBy="quiz", cascade={"persist"}, orphanRemoval=true))
*/
@ -234,7 +235,7 @@ class CQuiz extends AbstractResource implements ResourceInterface
}
/**
* @return ArrayCollection|CQuizRelQuestion[]
* @return Collection|CQuizRelQuestion[]
*/
public function getQuestions()
{

@ -19,7 +19,6 @@ use Symfony\Component\Validator\Constraints as Assert;
* @ORM\Table(
* name="c_quiz_question",
* indexes={
* @ORM\Index(name="course", columns={"c_id"}),
* @ORM\Index(name="position", columns={"position"})
* }
* )
@ -34,11 +33,6 @@ class CQuizQuestion extends AbstractResource implements ResourceInterface
*/
protected int $iid;
/**
* @ORM\Column(name="c_id", type="integer")
*/
protected int $cId;
/**
* @Assert\NotBlank()
*
@ -103,7 +97,7 @@ class CQuizQuestion extends AbstractResource implements ResourceInterface
protected $categories;
/**
* @var ArrayCollection|CQuizRelQuestion[]
* @var Collection|CQuizRelQuestion[]
*
* @ORM\OneToMany(targetEntity="CQuizRelQuestion", mappedBy="question", cascade={"persist"})
*/
@ -364,30 +358,6 @@ class CQuizQuestion extends AbstractResource implements ResourceInterface
return $this->questionCode;
}
/**
* Set cId.
*
* @param int $cId
*
* @return CQuizQuestion
*/
public function setCId($cId)
{
$this->cId = $cId;
return $this;
}
/**
* Get cId.
*
* @return int
*/
public function getCId()
{
return $this->cId;
}
/**
* @return string
*/
@ -416,9 +386,6 @@ class CQuizQuestion extends AbstractResource implements ResourceInterface
return $this->iid;
}
/**
* Resource identifier.
*/
public function getResourceIdentifier(): int
{
return $this->getIid();

@ -15,7 +15,6 @@ use Symfony\Component\Validator\Constraints as Assert;
* @ORM\Table(
* name="c_quiz_rel_question",
* indexes={
* @ORM\Index(name="course", columns={"c_id"}),
* @ORM\Index(name="question", columns={"question_id"}),
* @ORM\Index(name="exercise", columns={"quiz_id"})
* }
@ -31,11 +30,6 @@ class CQuizRelQuestion
*/
protected int $iid;
/**
* @ORM\Column(name="c_id", type="integer")
*/
protected int $cId;
/**
* @ORM\Column(name="question_order", type="integer", nullable=false)
*/
@ -79,30 +73,6 @@ class CQuizRelQuestion
return $this->questionOrder;
}
/**
* Set cId.
*
* @param int $cId
*
* @return CQuizRelQuestion
*/
public function setCId($cId)
{
$this->cId = $cId;
return $this;
}
/**
* Get cId.
*
* @return int
*/
public function getCId()
{
return $this->cId;
}
public function getQuiz(): CQuiz
{
return $this->quiz;

@ -67,7 +67,7 @@ class CThematicAdvance //extends AbstractResource implements ResourceInterface
* @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\Room")
* @ORM\JoinColumn(name="room_id", referencedColumnName="id")
*/
protected Room $room;
protected ?Room $room = null;
public function __construct()
{

@ -60,7 +60,7 @@ class CTool extends AbstractResource implements ResourceInterface
* @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\Session")
* @ORM\JoinColumn(name="session_id", referencedColumnName="id", nullable=true)
*/
protected ?Session $session;
protected ?Session $session = null;
/**
* @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\Tool")
@ -180,10 +180,7 @@ class CTool extends AbstractResource implements ResourceInterface
return $this->position;
}
/**
* @return CTool
*/
public function setPosition(int $position)
public function setPosition(int $position): self
{
$this->position = $position;

Loading…
Cancel
Save