Update entities

pull/3844/head
Julio Montoya 4 years ago
parent b5ff3fa333
commit 0df6314149
  1. 10
      src/CoreBundle/Entity/AccessUrlRelCourse.php
  2. 6
      src/CoreBundle/Entity/Asset.php
  3. 28
      src/CoreBundle/Entity/BranchSync.php
  4. 52
      src/CoreBundle/Entity/BranchTransaction.php
  5. 17
      src/CoreBundle/Entity/Course.php
  6. 40
      src/CoreBundle/Entity/CourseCategory.php
  7. 28
      src/CoreBundle/Entity/CourseRelUserCatalogue.php
  8. 6
      src/CoreBundle/Entity/ExtraField.php
  9. 24
      src/CoreBundle/Entity/GradebookCategory.php
  10. 24
      src/CoreBundle/Entity/GradebookEvaluation.php
  11. 24
      src/CoreBundle/Entity/GradebookLink.php
  12. 24
      src/CoreBundle/Entity/GradebookResult.php
  13. 32
      src/CoreBundle/Entity/GradebookScoreDisplay.php
  14. 24
      src/CoreBundle/Entity/GradebookScoreLog.php
  15. 5
      src/CoreBundle/Entity/Language.php
  16. 15
      src/CoreBundle/Entity/ResourceFile.php
  17. 31
      src/CourseBundle/Entity/CForumForum.php
  18. 14
      src/CourseBundle/Entity/CGlossary.php
  19. 5
      src/CourseBundle/Entity/CGroup.php
  20. 22
      src/CourseBundle/Entity/CLpCategory.php
  21. 4
      src/CourseBundle/Entity/CQuiz.php
  22. 4
      src/CourseBundle/Entity/CStudentPublication.php
  23. 11
      src/CourseBundle/Entity/CStudentPublicationCorrection.php
  24. 5
      src/CourseBundle/Entity/CSurvey.php
  25. 6
      src/CourseBundle/Entity/CSurveyQuestion.php

@ -30,13 +30,13 @@ class AccessUrlRelCourse
* @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\Course", inversedBy="urls", cascade={"persist"})
* @ORM\JoinColumn(name="c_id", referencedColumnName="id")
*/
protected $course;
protected Course $course;
/**
* @ORM\ManyToOne(targetEntity="AccessUrl", inversedBy="courses", cascade={"persist"})
* @ORM\JoinColumn(name="access_url_id", referencedColumnName="id")
*/
protected $url;
protected AccessUrl $url;
/**
* @return string
@ -58,12 +58,8 @@ class AccessUrlRelCourse
/**
* Set url.
*
* @param $url
*
* @return AccessUrlRelCourse
*/
public function setUrl(AccessUrl $url)
public function setUrl(AccessUrl $url): self
{
$this->url = $url;

@ -88,7 +88,7 @@ class Asset
protected ?string $originalName;
/**
* @var string
* @var array
*
* @Groups({"resource_file:read", "resource_node:read", "document:read"})
* @ORM\Column(type="simple_array", nullable=true)
@ -118,6 +118,7 @@ class Asset
public function __construct()
{
$this->metadata = [];
$this->dimensions = [];
$this->size = 0;
$this->compressed = false;
}
@ -245,9 +246,6 @@ class Asset
return $this->dimensions;
}
/**
* @param $dimensions
*/
public function setDimensions($dimensions): self
{
$this->dimensions = $dimensions;

@ -669,36 +669,10 @@ class BranchSync
return $this->root;
}
/**
* Set parentId.
*
* @param int $parentId
*
* @return BranchSync
*/
public function setParentId($parentId)
{
$this->parentId = $parentId;
return $this;
}
/**
* Get parentId.
*
* @return int
*/
public function getParentId()
{
return $this->parentId;
}
/**
* @param BranchSync $parent
*
* @return $this
*/
public function setParent(self $parent = null)
public function setParent(self $parent = null): self
{
$this->parent = $parent;

@ -112,62 +112,12 @@ class BranchTransaction
return $this->id;
}
/**
* Set transactionId.
*
* @param int $transactionId
*
* @return BranchTransaction
*/
public function setTransactionId($transactionId)
{
$this->transactionId = $transactionId;
return $this;
}
/**
* Get transactionId.
*
* @return int
*/
public function getTransactionId()
{
return $this->transactionId;
}
/**
* Set branchId.
*
* @param int $branchId
*
* @return BranchTransaction
*/
public function setBranchId($branchId)
{
$this->branchId = $branchId;
return $this;
}
/**
* Get branchId.
*
* @return int
*/
public function getBranchId()
{
return $this->branchId;
}
/**
* Set action.
*
* @param string $action
*
* @return BranchTransaction
*/
public function setAction($action)
public function setAction($action): self
{
$this->action = $action;

@ -405,8 +405,8 @@ class Course extends AbstractResource implements ResourceInterface, ResourceWith
$this->trackEAttempts = new ArrayCollection();
$this->searchEngineRefs = new ArrayCollection();
$this->templates = new ArrayCollection();
$this->specificFieldValues = new ArrayCollection();
$this->sharedSurveys = new ArrayCollection();
//$this->specificFieldValues = new ArrayCollection();
//$this->sharedSurveys = new ArrayCollection();
}
public function __toString(): string
@ -455,9 +455,6 @@ class Course extends AbstractResource implements ResourceInterface, ResourceWith
return $this->urls;
}
/**
* @param $urls
*/
public function setUrls(ArrayCollection $urls)
{
$this->urls = new ArrayCollection();
@ -494,14 +491,6 @@ class Course extends AbstractResource implements ResourceInterface, ResourceWith
return $this->users;
}
/**
* @return CGroup[]|ArrayCollection
*/
public function getGroups()
{
return $this->groups;
}
/**
* @return CourseRelUser[]|ArrayCollection
*/
@ -582,7 +571,7 @@ class Course extends AbstractResource implements ResourceInterface, ResourceWith
Criteria::expr()->eq('groups', $group)
);*/
return $this->getGroups()->contains($group);
//return $this->getGroups()->contains($group);
}
/**

@ -227,38 +227,12 @@ class CourseCategory
return $this->code;
}
/**
* Set parentId.
*
* @param string $parentId
*
* @return CourseCategory
*/
public function setParentId($parentId)
{
$this->parentId = $parentId;
return $this;
}
/**
* Get parentId.
*
* @return string
*/
public function getParentId()
{
return $this->parentId;
}
/**
* Set treePos.
*
* @param int $treePos
*
* @return CourseCategory
*/
public function setTreePos($treePos)
public function setTreePos($treePos): self
{
$this->treePos = $treePos;
@ -279,10 +253,8 @@ class CourseCategory
* Set childrenCount.
*
* @param int $childrenCount
*
* @return CourseCategory
*/
public function setChildrenCount($childrenCount)
public function setChildrenCount($childrenCount): self
{
$this->childrenCount = $childrenCount;
@ -303,10 +275,8 @@ class CourseCategory
* Set authCourseChild.
*
* @param string $authCourseChild
*
* @return CourseCategory
*/
public function setAuthCourseChild($authCourseChild)
public function setAuthCourseChild($authCourseChild): self
{
$this->authCourseChild = $authCourseChild;
@ -327,10 +297,8 @@ class CourseCategory
* Set authCatChild.
*
* @param string $authCatChild
*
* @return CourseCategory
*/
public function setAuthCatChild($authCatChild)
public function setAuthCatChild($authCatChild): self
{
$this->authCatChild = $authCatChild;

@ -95,38 +95,12 @@ class CourseRelUserCatalogue
return $this->course;
}
/**
* Set relationType.
*
* @param int $relationType
*
* @return CourseRelUserCatalogue
*/
public function setRelationType($relationType)
{
$this->relationType = $relationType;
return $this;
}
/**
* Get relationType.
*
* @return int
*/
public function getRelationType()
{
return $this->relationType;
}
/**
* Set visible.
*
* @param bool $visible
*
* @return CourseRelUserCatalogue
*/
public function setVisible($visible)
public function setVisible($visible): self
{
$this->visible = $visible;

@ -161,10 +161,8 @@ class ExtraField
/**
* @param int $extraFieldType
*
* @return $this
*/
public function setExtraFieldType($extraFieldType)
public function setExtraFieldType($extraFieldType): self
{
$this->extraFieldType = $extraFieldType;
@ -371,7 +369,7 @@ class ExtraField
public function getTypeToString(): string
{
switch ($this->type) {
switch ($this->getExtraFieldType()) {
case \ExtraField::FIELD_TYPE_RADIO:
case \ExtraField::FIELD_TYPE_SELECT:
return 'choice';

@ -293,30 +293,6 @@ class GradebookCategory
return $this->certifMinScore;
}
/**
* Set sessionId.
*
* @param int $sessionId
*
* @return GradebookCategory
*/
public function setSessionId($sessionId)
{
$this->sessionId = $sessionId;
return $this;
}
/**
* Get sessionId.
*
* @return int
*/
public function getSessionId()
{
return $this->sessionId;
}
/**
* Set documentId.
*

@ -180,30 +180,6 @@ class GradebookEvaluation
return $this->description;
}
/**
* Set categoryId.
*
* @param int $categoryId
*
* @return GradebookEvaluation
*/
public function setCategoryId($categoryId)
{
$this->categoryId = $categoryId;
return $this;
}
/**
* Get categoryId.
*
* @return int
*/
public function getCategoryId()
{
return $this->categoryId;
}
/**
* Set createdAt.
*

@ -178,30 +178,6 @@ class GradebookLink
return $this->refId;
}
/**
* Set categoryId.
*
* @param int $categoryId
*
* @return GradebookLink
*/
public function setCategoryId($categoryId)
{
$this->categoryId = $categoryId;
return $this;
}
/**
* Get categoryId.
*
* @return int
*/
public function getCategoryId()
{
return $this->categoryId;
}
/**
* Set createdAt.
*

@ -58,30 +58,6 @@ class GradebookResult
*/
protected $createdAt;
/**
* Set evaluationId.
*
* @param int $evaluationId
*
* @return GradebookResult
*/
public function setEvaluationId($evaluationId)
{
$this->evaluationId = $evaluationId;
return $this;
}
/**
* Get evaluationId.
*
* @return int
*/
public function getEvaluationId()
{
return $this->evaluationId;
}
/**
* Set createdAt.
*

@ -76,10 +76,8 @@ class GradebookScoreDisplay
* Set display.
*
* @param string $display
*
* @return GradebookScoreDisplay
*/
public function setDisplay($display)
public function setDisplay($display): self
{
$this->display = $display;
@ -96,38 +94,12 @@ class GradebookScoreDisplay
return $this->display;
}
/**
* Set categoryId.
*
* @param int $categoryId
*
* @return GradebookScoreDisplay
*/
public function setCategoryId($categoryId)
{
$this->categoryId = $categoryId;
return $this;
}
/**
* Get categoryId.
*
* @return int
*/
public function getCategoryId()
{
return $this->categoryId;
}
/**
* Set scoreColorPercent.
*
* @param float $scoreColorPercent
*
* @return GradebookScoreDisplay
*/
public function setScoreColorPercent($scoreColorPercent)
public function setScoreColorPercent($scoreColorPercent): self
{
$this->scoreColorPercent = $scoreColorPercent;

@ -57,16 +57,6 @@ class GradebookScoreLog
*/
protected $registeredAt;
/**
* Get the category id.
*
* @return int
*/
public function getCategoryId()
{
return $this->categoryId;
}
/**
* Get the achieved score.
*
@ -97,20 +87,6 @@ class GradebookScoreLog
return $this->id;
}
/**
* Set the category id.
*
* @param int $categoryId
*
* @return $this
*/
public function setCategoryId($categoryId)
{
$this->categoryId = $categoryId;
return $this;
}
/**
* Set the achieved score.
*

@ -69,12 +69,9 @@ class Language
*/
protected $subLanguages;
/**
* Language constructor.
*/
public function __construct()
{
$this->children = new ArrayCollection();
//$this->children = new ArrayCollection();
}
/**

@ -331,9 +331,6 @@ class ResourceFile
return $this->dimensions;
}
/**
* @param $dimensions
*/
public function setDimensions($dimensions): self
{
$this->dimensions = $dimensions;
@ -410,16 +407,4 @@ class ResourceFile
return $this;
}
public function getContentUrl(): ?string
{
return $this->contentUrl;
}
public function setContentUrl(?string $contentUrl): self
{
$this->contentUrl = $contentUrl;
return $this;
}
}

@ -685,30 +685,6 @@ class CForumForum extends AbstractResource implements ResourceInterface
return $this->cId;
}
/**
* Set lpId.
*
* @param int $lpId
*
* @return CForumForum
*/
public function setLpId($lpId)
{
$this->lpId = $lpId;
return $this;
}
/**
* Get lpId.
*
* @return int
*/
public function getLpId()
{
return $this->lpId;
}
/**
* @return bool
*/
@ -717,12 +693,7 @@ class CForumForum extends AbstractResource implements ResourceInterface
return $this->moderated;
}
/**
* @param $moderated
*
* @return $this
*/
public function setModerated($moderated)
public function setModerated($moderated): self
{
$this->moderated = $moderated;

@ -108,20 +108,6 @@ class CGlossary extends AbstractResource implements ResourceInterface
return $this->displayOrder;
}
/**
* Set glossaryId.
*
* @param int $glossaryId
*
* @return CGlossary
*/
public function setGlossaryId($glossaryId)
{
$this->glossaryId = $glossaryId;
return $this;
}
public function getIid(): int
{
return $this->iid;

@ -538,7 +538,7 @@ class CGroup extends AbstractResource implements ResourceInterface
public function userIsTutor(User $user = null): bool
{
if (empty($user)) {
if (null === $user) {
return false;
}
@ -547,9 +547,6 @@ class CGroup extends AbstractResource implements ResourceInterface
}
$criteria = Criteria::create()
->where(
Criteria::expr()->eq('cId', $this->course)
)
->andWhere(
Criteria::expr()->eq('user', $user)
);

@ -54,12 +54,16 @@ class CLpCategory extends AbstractResource implements ResourceInterface
protected string $name;
/**
* @var int
*
* @Gedmo\SortablePosition
* @ORM\Column(name="position", type="integer")
*/
protected $position;
/**
* @var ArrayCollection|CLpCategoryUser
*
* @ORM\OneToMany(
* targetEntity="Chamilo\CourseBundle\Entity\CLpCategoryUser",
* mappedBy="category",
@ -76,9 +80,6 @@ class CLpCategory extends AbstractResource implements ResourceInterface
*/
protected $lps;
/**
* CLpCategory constructor.
*/
public function __construct()
{
$this->users = new ArrayCollection();
@ -99,10 +100,8 @@ class CLpCategory extends AbstractResource implements ResourceInterface
* Set cId.
*
* @param int $cId
*
* @return CLpCategory
*/
public function setCId($cId)
public function setCId($cId): self
{
$this->cId = $cId;
@ -134,12 +133,7 @@ class CLpCategory extends AbstractResource implements ResourceInterface
return $this->name;
}
/**
* @param $position
*
* @return $this
*/
public function setPosition($position)
public function setPosition($position): self
{
$this->position = $position;
@ -170,13 +164,9 @@ class CLpCategory extends AbstractResource implements ResourceInterface
return $this->users;
}
/**
* @param $users
*/
public function setUsers($users)
{
$this->users = new ArrayCollection();
foreach ($users as $user) {
$this->addUser($user);
}

@ -265,7 +265,7 @@ class CQuiz extends AbstractResource implements ResourceInterface
$this->type = self::ONE_PER_PAGE;
$this->showPreviousButton = true;
$this->notifications = '';
$this->autoLaunch = 0;
$this->autoLaunch = false;
$this->preventBackwards = 0;
$this->random = 0;
$this->randomAnswers = false;
@ -275,7 +275,7 @@ class CQuiz extends AbstractResource implements ResourceInterface
$this->feedbackType = 0;
$this->expiredTime = 0;
$this->propagateNeg = 0;
$this->saveCorrectAnswers = false;
$this->saveCorrectAnswers = 0;
$this->reviewAnswers = 0;
$this->randomByCategory = 0;
$this->displayCategoryName = 0;

@ -68,7 +68,7 @@ class CStudentPublication extends AbstractResource implements ResourceInterface
protected $author;
/**
* @var bool
* @var int
*
* @ORM\Column(name="active", type="integer", nullable=true)
*/
@ -317,7 +317,7 @@ class CStudentPublication extends AbstractResource implements ResourceInterface
/**
* Get active.
*
* @return bool
* @return int
*/
public function getActive()
{

@ -43,12 +43,8 @@ class CStudentPublicationCorrection extends AbstractResource implements Resource
/**
* Set title.
*
* @param string $title
*
* @return CStudentPublication
*/
public function setTitle($title)
public function setTitle($title): self
{
$this->title = $title;
@ -65,14 +61,11 @@ class CStudentPublicationCorrection extends AbstractResource implements Resource
return $this->title;
}
public function getId(): int
public function getId()
{
return $this->id;
}
/**
* Resource identifier.
*/
public function getResourceIdentifier(): int
{
return $this->getId();

@ -239,13 +239,12 @@ class CSurvey extends AbstractResource implements ResourceInterface
$this->creationDate = new \DateTime();
$this->invited = 0;
$this->answered = 0;
$this->surveyId = 0;
$this->subtitle = '';
$this->inviteMail = '';
$this->reminderMail = '';
$this->mailSubject = '';
$this->shuffle = 0;
$this->oneQuestionPerPage = 0;
$this->shuffle = false;
$this->oneQuestionPerPage = false;
$this->surveyVersion = '';
$this->parentId = 0;
$this->surveyType = 0;

@ -143,9 +143,9 @@ class CSurveyQuestion
public function __construct()
{
$this->surveyGroupPri = '';
$this->surveyGroupSec1 = '';
$this->surveyGroupSec2 = '';
$this->surveyGroupPri = 0;
$this->surveyGroupSec1 = 0;
$this->surveyGroupSec2 = 0;
}
public function getIid(): int

Loading…
Cancel
Save