Update entities

pull/3844/head
Julio Montoya 4 years ago
parent 624452fbd4
commit aa2d2d4cd5
  1. 2
      src/CoreBundle/Entity/ExtraField.php
  2. 18
      src/CoreBundle/Entity/ExtraFieldOptions.php
  3. 18
      src/CoreBundle/Entity/ExtraFieldRelTag.php
  4. 5
      src/CoreBundle/Entity/ExtraFieldValues.php
  5. 72
      src/CoreBundle/Entity/GradebookCategory.php
  6. 36
      src/CoreBundle/Entity/GradebookCertificate.php
  7. 11
      src/CoreBundle/Entity/GradebookEvaluation.php
  8. 13
      src/CoreBundle/Entity/GradebookLink.php
  9. 4
      src/CoreBundle/Entity/GradebookLinkevalLog.php
  10. 11
      src/CoreBundle/Entity/GradebookResult.php
  11. 11
      src/CoreBundle/Entity/GradebookScoreDisplay.php
  12. 11
      src/CoreBundle/Entity/GradebookScoreLog.php
  13. 8
      src/CoreBundle/Entity/Promotion.php
  14. 10
      src/CoreBundle/Entity/ResourceComment.php
  15. 4
      src/CoreBundle/Entity/ResourceFile.php
  16. 15
      src/CoreBundle/Entity/ResourceLink.php

@ -16,7 +16,7 @@ use Symfony\Component\Validator\Constraints as Assert;
*
* @ORM\MappedSuperclass
*/
class ExtraField // extends BaseAttribute
class ExtraField
{
public const USER_FIELD_TYPE = 1;
public const COURSE_FIELD_TYPE = 2;

@ -29,35 +29,27 @@ class ExtraFieldOptions
* @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\ExtraField", inversedBy="options")
* @ORM\JoinColumn(name="field_id", referencedColumnName="id")
*/
protected $field;
protected ExtraField $field;
/**
* @var string
*
* @ORM\Column(name="option_value", type="text", nullable=true)
*/
protected $value;
protected ?string $value;
/**
* @var string
*
* @ORM\Column(name="display_text", type="string", length=255, nullable=true)
*/
protected $displayText;
protected ?string $displayText;
/**
* @var string
*
* @ORM\Column(name="priority", type="string", length=255, nullable=true)
*/
protected $priority;
protected ?string $priority;
/**
* @var string
*
* @ORM\Column(name="priority_message", type="string", length=255, nullable=true)
*/
protected $priorityMessage;
protected ?string $priorityMessage;
/**
* @var int

@ -22,6 +22,15 @@ use Doctrine\ORM\Mapping as ORM;
*/
class ExtraFieldRelTag
{
/**
* @var int
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="IDENTITY")
*/
protected $id;
/**
* @var int
*
@ -43,15 +52,6 @@ class ExtraFieldRelTag
*/
protected $itemId;
/**
* @var int
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="IDENTITY")
*/
protected $id;
/**
* Set fieldId.
*

@ -61,10 +61,7 @@ class ExtraFieldValues
$this->comment = '';
}
/**
* @return ExtraField
*/
public function getField()
public function getField(): ExtraField
{
return $this->field;
}

@ -4,6 +4,7 @@
namespace Chamilo\CoreBundle\Entity;
use Chamilo\CoreBundle\Traits\CourseTrait;
use Chamilo\CoreBundle\Traits\UserTrait;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM;
@ -12,13 +13,13 @@ use Symfony\Component\Validator\Constraints as Assert;
/**
* @ORM\Table(name="gradebook_category",
* indexes={
* @ORM\Index(name="idx_gb_cat_parent", columns={"parent_id"}),
* }))
* @ORM\Entity
*/
class GradebookCategory
{
use UserTrait;
use CourseTrait;
/**
* @var int
@ -42,25 +43,28 @@ class GradebookCategory
protected ?string $description;
/**
* @var User
*
* @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\User", inversedBy="gradeBookCategories")
* @ORM\JoinColumn(name="user_id", referencedColumnName="id")
*/
protected $user;
protected User $user;
/**
* @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\Course", inversedBy="gradebookCategories")
* @ORM\JoinColumn(name="c_id", referencedColumnName="id")
*/
protected $course;
protected Course $course;
/**
* @var int
*
* @ORM\Column(name="parent_id", type="integer", nullable=true)
* @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\GradebookCategory")
* @ORM\JoinColumn(name="parent_id",referencedColumnName="id")
*/
protected ?GradebookCategory $parent;
/**
* @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\Session")
* @ORM\JoinColumn(name="session_id", referencedColumnName="id")
*/
protected $parentId;
protected ?Session $session;
/**
* @var float
@ -83,12 +87,6 @@ class GradebookCategory
*/
protected $certifMinScore;
/**
* @var int
*
* @ORM\Column(name="session_id", type="integer", nullable=true)
*/
protected $sessionId;
/**
* @var int
@ -226,50 +224,6 @@ class GradebookCategory
return $this->description;
}
/**
* Set course.
*/
public function setCourse(Course $course): self
{
$this->course = $course;
return $this;
}
/**
* Get course.
*
* @return Course
*/
public function getCourse()
{
return $this->course;
}
/**
* Set parentId.
*
* @param int $parentId
*
* @return GradebookCategory
*/
public function setParentId($parentId)
{
$this->parentId = $parentId;
return $this;
}
/**
* Get parentId.
*
* @return int
*/
public function getParentId()
{
return $this->parentId;
}
/**
* Set weight.
*

@ -11,9 +11,8 @@ use Doctrine\ORM\Mapping as ORM;
* @ORM\Table(
* name="gradebook_certificate",
* indexes={
* @ORM\Index(name="idx_gradebook_certificate_category_id", columns={"cat_id"}),
* @ORM\Index(name="idx_gradebook_certificate_user_id", columns={"user_id"}),
* @ORM\Index(name="idx_gradebook_certificate_category_id_user_id", columns={"cat_id", "user_id"})}
* }
* )
* @ORM\Entity
*/
@ -31,15 +30,14 @@ class GradebookCertificate
protected $id;
/**
* @var int
*
* @ORM\Column(name="cat_id", type="integer", nullable=false)
* @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\GradebookCategory")
* @ORM\JoinColumn(name="cat_id", referencedColumnName="id")
*/
protected $catId;
protected GradebookCategory $category;
/**
* @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\User", inversedBy="gradeBookCertificates")
* @ORM\JoinColumn(name="user_id",referencedColumnName="id",onDelete="CASCADE")
* @ORM\JoinColumn(name="user_id",referencedColumnName="id", onDelete="CASCADE")
*/
protected User $user;
@ -71,30 +69,6 @@ class GradebookCertificate
*/
protected $downloadedAt;
/**
* Set catId.
*
* @param int $catId
*
* @return GradebookCertificate
*/
public function setCatId($catId)
{
$this->catId = $catId;
return $this;
}
/**
* Get catId.
*
* @return int
*/
public function getCatId()
{
return $this->catId;
}
/**
* Set scoreCertificate.
*

@ -48,20 +48,19 @@ class GradebookEvaluation
* @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\User", inversedBy="gradeBookEvaluations")
* @ORM\JoinColumn(name="user_id", referencedColumnName="id", onDelete="CASCADE")
*/
protected $user;
protected User $user;
/**
* @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\Course", inversedBy="gradebookEvaluations")
* @ORM\JoinColumn(name="c_id", referencedColumnName="id")
*/
protected $course;
protected Course $course;
/**
* @var int
*
* @ORM\Column(name="category_id", type="integer", nullable=true)
* @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\GradebookCategory")
* @ORM\JoinColumn(name="category_id", referencedColumnName="id")
*/
protected $categoryId;
protected GradebookCategory $category;
/**
* @var \DateTime

@ -48,25 +48,22 @@ class GradebookLink
protected $refId;
/**
* @var User
*
* @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\User", inversedBy="gradeBookLinks")
* @ORM\JoinColumn(name="user_id", referencedColumnName="id", onDelete="CASCADE")
*/
protected $user;
protected User $user;
/**
* @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\Course", inversedBy="gradebookLinks")
* @ORM\JoinColumn(name="c_id", referencedColumnName="id")
*/
protected $course;
protected Course $course;
/**
* @var int
*
* @ORM\Column(name="category_id", type="integer", nullable=false)
* @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\GradebookCategory")
* @ORM\JoinColumn(name="category_id", referencedColumnName="id")
*/
protected $categoryId;
protected GradebookCategory $category;
/**
* @var \DateTime

@ -70,12 +70,10 @@ class GradebookLinkevalLog
protected $type;
/**
* @var User
*
* @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\User", inversedBy="gradeBookLinkEvalLogs")
* @ORM\JoinColumn(name="user_id_log", referencedColumnName="id", onDelete="CASCADE")
*/
protected $user;
protected User $user;
/**
* @var \DateTime

@ -32,11 +32,10 @@ class GradebookResult
protected $id;
/**
* @var int
*
* @ORM\Column(name="evaluation_id", type="integer", nullable=false)
* @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\GradebookEvaluation")
* @ORM\JoinColumn(name="evaluation_id", referencedColumnName="id")
*/
protected $evaluationId;
protected GradebookEvaluation $evaluation;
/**
* @var float
@ -54,12 +53,10 @@ class GradebookResult
protected $createdAt;
/**
* @var User
*
* @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\User", inversedBy="gradeBookResults")
* @ORM\JoinColumn(name="user_id", referencedColumnName="id", onDelete="CASCADE")
*/
protected $user;
protected User $user;
/**
* Set evaluationId.

@ -31,18 +31,15 @@ class GradebookScoreDisplay
protected $score;
/**
* @var string
*
* @ORM\Column(name="display", type="string", length=40, nullable=false)
*/
protected $display;
protected ?string $display;
/**
* @var int
*
* @ORM\Column(name="category_id", type="integer", nullable=false)
* @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\GradebookCategory")
* @ORM\JoinColumn(name="category_id",referencedColumnName="id")
*/
protected $categoryId;
protected GradebookCategory $category;
/**
* @var float

@ -32,19 +32,16 @@ class GradebookScoreLog
protected $id;
/**
* @var int
*
* @ORM\Column(name="category_id", type="integer", nullable=false)
* @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\GradebookCategory")
* @ORM\JoinColumn(name="category_id",referencedColumnName="id")
*/
protected $categoryId;
protected GradebookCategory $category;
/**
* @var User
*
* @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\User", inversedBy="gradeBookScoreLogs")
* @ORM\JoinColumn(name="user_id", referencedColumnName="id", onDelete="CASCADE")
*/
protected $user;
protected User $user;
/**
* @var float

@ -39,19 +39,15 @@ class Promotion
protected ?string $description;
/**
* @var Career
*
* @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\Career")
* @ORM\JoinColumn(name="career_id", referencedColumnName="id")
*/
protected $career;
protected Career $career;
/**
* @var int
*
* @ORM\Column(name="status", type="integer", nullable=false)
*/
protected $status;
protected int $status;
/**
* Get id.

@ -42,26 +42,22 @@ class ResourceComment
* @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\ResourceNode", inversedBy="comments")
* @ORM\JoinColumn(name="resource_node_id", referencedColumnName="id", onDelete="SET NULL")
*/
protected $resourceNode;
protected ResourceNode $resourceNode;
/**
* @var User
*
* @Groups({"comment:read"})
* @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\User")
* @ORM\JoinColumn(name="author_id", referencedColumnName="id", onDelete="SET NULL")
*/
protected $author;
protected User $author;
/**
* @var string
*
* @Groups({"comment:read"})
* @Assert\NotBlank()
*
* @ORM\Column(name="content", type="string", nullable=false)
*/
protected $content;
protected string $content;
/**
* @Gedmo\TreeParent

@ -88,13 +88,13 @@ class ResourceFile
* @Groups({"resource_file:read", "resource_node:read", "document:read"})
* @ORM\Column(type="text", nullable=true)
*/
protected $mimeType;
protected ?string $mimeType;
/**
* @Groups({"resource_file:read", "resource_node:read", "document:read"})
* @ORM\Column(type="text", nullable=true)
*/
protected $originalName;
protected ?string $originalName;
/**
* @var string

@ -33,37 +33,37 @@ class ResourceLink
* @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\ResourceNode", inversedBy="resourceLinks")
* @ORM\JoinColumn(name="resource_node_id", referencedColumnName="id", onDelete="SET NULL")
*/
protected $resourceNode;
protected ResourceNode $resourceNode;
/**
* @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\Course", inversedBy="resourceLinks")
* @ORM\JoinColumn(name="c_id", referencedColumnName="id", nullable=true)
*/
protected $course;
protected ?Course $course;
/**
* @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\Session", inversedBy="resourceLinks")
* @ORM\JoinColumn(name="session_id", referencedColumnName="id", nullable=true)
*/
protected $session;
protected ?Session $session;
/**
* @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\User")
* @ORM\JoinColumn(name="user_id", referencedColumnName="id", nullable=true)
*/
protected $user;
protected ?User $user;
/**
* @ORM\ManyToOne(targetEntity="Chamilo\CourseBundle\Entity\CGroup")
* @ORM\JoinColumn(name="group_id", referencedColumnName="iid", nullable=true, onDelete="CASCADE")
*/
protected $group;
protected ?CGroup $group;
/**
* @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\Usergroup")
* @ORM\JoinColumn(name="usergroup_id", referencedColumnName="id", nullable=true)
*/
protected $userGroup;
protected ?Usergroup $userGroup;
/**
* @ORM\OneToMany(
@ -92,9 +92,6 @@ class ResourceLink
*/
protected $endVisibilityAt;
/**
* Constructor.
*/
public function __construct()
{
$this->resourceRight = new ArrayCollection();

Loading…
Cancel
Save