Update entities

pull/3768/head
Julio Montoya 4 years ago
parent eccb1a40ab
commit 6f257f35fc
  1. 19
      src/CoreBundle/Entity/Message.php
  2. 9
      src/CoreBundle/Entity/PersonalAgenda.php
  3. 4
      src/CoreBundle/Entity/PersonalFile.php
  4. 16
      src/CoreBundle/Entity/ResourceFile.php
  5. 14
      src/CoreBundle/Entity/ResourceNode.php
  6. 7
      src/CoreBundle/Entity/ResourceType.php
  7. 11
      src/CoreBundle/Entity/ScheduledAnnouncement.php
  8. 36
      src/CoreBundle/Entity/Session.php
  9. 13
      src/CoreBundle/Entity/Skill.php
  10. 18
      src/CourseBundle/Entity/CAttendance.php
  11. 8
      src/CourseBundle/Entity/CCourseDescription.php
  12. 4
      src/CourseBundle/Entity/CCourseSetting.php
  13. 9
      src/CourseBundle/Entity/CDocument.php
  14. 7
      src/CourseBundle/Entity/CForumCategory.php
  15. 6
      src/CourseBundle/Entity/CForumThread.php

@ -59,19 +59,17 @@ class Message
protected $sendDate;
/**
* @var string
* @Assert\NotBlank
* @ORM\Column(name="title", type="string", length=255, nullable=false)
*/
protected $title;
protected string $title;
/**
* @var string
* @Assert\NotBlank
*
* @ORM\Column(name="content", type="text", nullable=false)
*/
protected $content;
protected string $content;
/**
* @var int
@ -120,16 +118,15 @@ class Message
*/
public function __construct()
{
$this->content = '';
$this->attachments = new ArrayCollection();
$this->likes = new ArrayCollection();
}
/**
* Set userSender.
*
* @return Message
*/
public function setUserSender(User $userSender)
public function setUserSender(User $userSender): self
{
$this->userSender = $userSender;
@ -138,20 +135,16 @@ class Message
/**
* Get userSender.
*
* @return User
*/
public function getUserSender()
public function getUserSender(): User
{
return $this->userSender;
}
/**
* Set userReceiver.
*
* @return Message
*/
public function setUserReceiver(User $userReceiver)
public function setUserReceiver(User $userReceiver): self
{
$this->userReceiver = $userReceiver;

@ -6,6 +6,7 @@ namespace Chamilo\CoreBundle\Entity;
use Chamilo\CoreBundle\Traits\UserTrait;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
/**
* PersonalAgenda.
@ -28,19 +29,17 @@ class PersonalAgenda
protected $id;
/**
* @var User
*
* @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\User", inversedBy="personalAgendas")
* @ORM\JoinColumn(name="user", referencedColumnName="id", onDelete="CASCADE")
*/
protected $user;
protected User $user;
/**
* @var string
* @Assert\NotBlank()
*
* @ORM\Column(name="title", type="text", nullable=true)
*/
protected $title;
protected string $title;
/**
* @var string

@ -27,11 +27,9 @@ class PersonalFile extends AbstractResource implements ResourceInterface
protected $id;
/**
* @var string
*
* @ORM\Column(name="name", type="string", length=255, nullable=false)
*/
protected $name;
protected string $name;
public function __construct()
{

@ -77,30 +77,24 @@ class ResourceFile
protected $id;
/**
* @var string
*
* @Assert\NotBlank()
* @Groups({"resource_file:read", "resource_node:read", "document:read"})
*
* @ORM\Column(type="string", length=255)
*/
protected $name;
protected string $name;
/**
* @var string
*
* @Groups({"resource_file:read", "resource_node:read", "document:read"})
* @ORM\Column(type="text", nullable=true)
*/
protected $mimeType;
protected string $mimeType;
/**
* @var string
*
* @Groups({"resource_file:read", "resource_node:read", "document:read"})
* @ORM\Column(type="text", nullable=true)
*/
protected $originalName;
protected string $originalName;
/**
* @var string
@ -142,11 +136,9 @@ class ResourceFile
protected $crop;
/**
* @var ResourceNode
*
* @ORM\OneToOne(targetEntity="Chamilo\CoreBundle\Entity\ResourceNode", mappedBy="resourceFile")
*/
protected $resourceNode;
protected ResourceNode $resourceNode;
/**
* @var array

@ -63,7 +63,7 @@ class ResourceNode
*
* @ORM\Column(name="title", type="string", length=255, nullable=false)
*/
protected $title;
protected string $title;
/**
* @Assert\NotBlank()
@ -71,15 +71,13 @@ class ResourceNode
* @Gedmo\Slug(fields={"title"})
* @ORM\Column(name="slug", type="string", length=255, nullable=false)
*/
protected $slug;
protected string $slug;
/**
* @var ResourceType
*
* @ORM\ManyToOne(targetEntity="ResourceType", inversedBy="resourceNodes")
* @ORM\JoinColumn(name="resource_type_id", referencedColumnName="id", nullable=false)
*/
protected $resourceType;
protected ResourceType $resourceType;
/**
* @ApiSubresource()
@ -91,14 +89,14 @@ class ResourceNode
protected $resourceLinks;
/**
* @var ResourceFile available file for this node
* ResourceFile available file for this node
*
* @Groups({"resource_node:read", "resource_node:write", "document:read", "document:write"})
*
* @ORM\OneToOne(targetEntity="ResourceFile", inversedBy="resourceNode", orphanRemoval=true)
* @ORM\JoinColumn(name="resource_file_id", referencedColumnName="id", onDelete="CASCADE")
*/
protected $resourceFile;
protected ResourceFile $resourceFile;
/**
* @var User the creator of this node
@ -107,7 +105,7 @@ class ResourceNode
* @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\User", inversedBy="resourceNodes")
* @ORM\JoinColumn(name="creator_id", referencedColumnName="id", nullable=true, onDelete="CASCADE")
*/
protected $creator;
protected User $creator;
/**
* @ApiSubresource()

@ -28,22 +28,19 @@ class ResourceType
*
* @Assert\NotBlank()
*/
protected $name;
protected string $name;
/**
* @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\Tool", inversedBy="resourceTypes")
* @ORM\JoinColumn(name="tool_id", referencedColumnName="id")
*/
protected $tool;
protected Tool $tool;
/**
* @ORM\OneToMany(targetEntity="Chamilo\CoreBundle\Entity\ResourceNode", mappedBy="resourceType", cascade={"persist", "remove"})
*/
protected $resourceNodes;
/**
* Constructor.
*/
public function __construct()
{
}

@ -24,18 +24,14 @@ class ScheduledAnnouncement
protected $id;
/**
* @var string
*
* @ORM\Column(name="subject", type="string", length=255, nullable=false, unique=false)
*/
protected $subject;
protected string $subject;
/**
* @var string
*
* @ORM\Column(name="message", type="text", unique=false)
*/
protected $message;
protected string $message;
/**
* @var \DateTime
@ -65,9 +61,6 @@ class ScheduledAnnouncement
*/
protected $cId;
/**
* Constructor.
*/
public function __construct()
{
}

@ -161,32 +161,27 @@ class Session
protected $showDescription;
/**
* @var int
*
* @ORM\Column(name="duration", type="integer", nullable=true)
*/
protected $duration;
protected int $duration;
/**
* @var int
* @Groups({"session:read"})
* @ORM\Column(name="nbr_courses", type="smallint", nullable=true, unique=false)
*/
protected $nbrCourses;
protected int $nbrCourses;
/**
* @var int
* @Groups({"session:read"})
* @ORM\Column(name="nbr_users", type="integer", nullable=true, unique=false)
*/
protected $nbrUsers;
protected int $nbrUsers;
/**
* @var int
* @Groups({"session:read"})
* @ORM\Column(name="nbr_classes", type="integer", nullable=true, unique=false)
*/
protected $nbrClasses;
protected int $nbrClasses;
/**
* @var User
@ -314,6 +309,7 @@ class Session
$this->description = '';
$this->nbrClasses = 0;
$this->nbrUsers = 0;
$this->nbrCourses = 0;
$this->sendSubscriptionNotification = false;
$this->displayStartDate = new \DateTime();
$this->displayEndDate = new \DateTime();
@ -333,38 +329,24 @@ class Session
$this->studentPublications = new ArrayCollection();
}
/**
* @return string
*/
public function __toString()
public function __toString(): string
{
return (string) $this->getName();
}
/**
* @return int
*/
public function getDuration()
public function getDuration(): int
{
return $this->duration;
}
/**
* @param int $duration
*
* @return $this
*/
public function setDuration($duration)
public function setDuration(int $duration): self
{
$this->duration = $duration;
return $this;
}
/**
* @return string
*/
public function getShowDescription()
public function getShowDescription(): bool
{
return $this->showDescription;
}

@ -57,30 +57,27 @@ class Skill
protected $id;
/**
* @var string
* @Groups({"skill:read", "skill:write"})
* @Assert\NotBlank()
*
* @ORM\Column(name="name", type="string", length=255, nullable=false)
*/
protected $name;
protected string $name;
/**
* @var string
* @Assert\NotBlank()
* @Groups({"skill:read", "skill:write"})
*
* @ORM\Column(name="short_code", type="string", length=100, nullable=false)
*/
protected $shortCode;
protected string $shortCode;
/**
* @var string
* @Groups({"skill:read", "skill:write"})
*
* @ORM\Column(name="description", type="text", nullable=false)
*/
protected $description;
protected string $description;
/**
* @var int
@ -119,11 +116,9 @@ class Skill
*/
protected $updatedAt;
/**
* Constructor.
*/
public function __construct()
{
$this->description = '';
$this->status = self::STATUS_ENABLED;
}

@ -32,18 +32,15 @@ class CAttendance extends AbstractResource implements ResourceInterface
protected $iid;
/**
* @var string
* @Assert\NotBlank
* @ORM\Column(name="name", type="text", nullable=false)
*/
protected $name;
protected string $name;
/**
* @var string
*
* @ORM\Column(name="description", type="text", nullable=true)
*/
protected $description;
protected string $description;
/**
* @var int
@ -82,6 +79,7 @@ class CAttendance extends AbstractResource implements ResourceInterface
public function __construct()
{
$this->description = '';
$this->active = 1;
$this->attendanceQualifyMax = 0;
$this->locked = 0;
@ -94,12 +92,8 @@ class CAttendance extends AbstractResource implements ResourceInterface
/**
* Set name.
*
* @param string $name
*
* @return CAttendance
*/
public function setName($name)
public function setName(string $name): self
{
$this->name = $name;
@ -120,10 +114,8 @@ class CAttendance extends AbstractResource implements ResourceInterface
* Set description.
*
* @param string $description
*
* @return CAttendance
*/
public function setDescription($description)
public function setDescription($description): self
{
$this->description = $description;

@ -36,13 +36,11 @@ class CCourseDescription extends AbstractResource implements ResourceInterface
protected $iid;
/**
* @var string
*
* @Assert\NotBlank
*
* @ORM\Column(name="title", type="text", nullable=true)
*/
protected $title;
protected string $title;
/**
* @var string
@ -65,11 +63,9 @@ class CCourseDescription extends AbstractResource implements ResourceInterface
*/
protected $progress;
/**
* CCourseDescription constructor.
*/
public function __construct()
{
$this->content = '';
$this->progress = 0;
$this->descriptionType = 1;
}

@ -37,13 +37,11 @@ class CCourseSetting
protected $cId;
/**
* @var string
*
* @Assert\NotBlank()
*
* @ORM\Column(name="variable", type="string", length=255, nullable=false)
*/
protected $variable;
protected string $variable;
/**
* @var string

@ -136,27 +136,25 @@ class CDocument extends AbstractResource implements ResourceInterface
protected $iid;
/**
* @var string
* @Assert\NotBlank
* @Groups({"document:read", "document:write"})
* @ORM\Column(name="title", type="string", length=255, nullable=true)
*/
protected $title;
protected string $title;
/**
* @var string
* @Groups({"document:read", "document:write"})
* @ORM\Column(name="comment", type="text", nullable=true)
*/
protected $comment;
protected string $comment;
/**
* @var string File type, it can be 'folder' or 'file'
* @Groups({"document:read", "document:write"})
* @Assert\Choice({"folder", "file"}, message="Choose a valid filetype.")
* @ORM\Column(name="filetype", type="string", length=10, nullable=false)
*/
protected $filetype;
protected string $filetype;
/**
* @var bool
@ -175,6 +173,7 @@ class CDocument extends AbstractResource implements ResourceInterface
*/
public function __construct()
{
$this->comment = '';
$this->filetype = 'folder';
$this->readonly = false;
$this->template = false;

@ -41,20 +41,18 @@ class CForumCategory extends AbstractResource implements ResourceInterface
protected $cId;
/**
* @var string
*
* @Assert\NotBlank()
*
* @ORM\Column(name="cat_title", type="string", length=255, nullable=false)
*/
protected $catTitle;
protected string $catTitle;
/**
* @var string
*
* @ORM\Column(name="cat_comment", type="text", nullable=true)
*/
protected $catComment;
protected string $catComment;
/**
* @var int
@ -93,6 +91,7 @@ class CForumCategory extends AbstractResource implements ResourceInterface
public function __construct()
{
$this->catComment = '';
$this->locked = 0;
$this->catId = 0;
$this->forums = new ArrayCollection();

@ -42,13 +42,11 @@ class CForumThread extends AbstractResource implements ResourceInterface
protected $cId;
/**
* @var string
*
* @Assert\NotBlank()
*
* @ORM\Column(name="thread_title", type="string", length=255, nullable=true)
*/
protected $threadTitle;
protected string $threadTitle;
/**
* @var CForumForum|null
@ -71,7 +69,7 @@ class CForumThread extends AbstractResource implements ResourceInterface
* @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\User")
* @ORM\JoinColumn(name="thread_poster_id", referencedColumnName="id")
*/
protected $user;
protected User $user;
/**
* @var int

Loading…
Cancel
Save