Update entities

pull/3844/head
Julio Montoya 4 years ago
parent 7e642ce270
commit b5184b436e
  1. 2
      src/CoreBundle/Entity/AccessUrl.php
  2. 7
      src/CoreBundle/Entity/CourseRelUserCatalogue.php
  3. 12
      src/CoreBundle/Entity/ExtraFieldValues.php
  4. 7
      src/CoreBundle/Entity/Session.php
  5. 11
      src/CoreBundle/Entity/SessionRelUser.php
  6. 15
      src/CoreBundle/Entity/SysAnnouncement.php
  7. 2
      src/CoreBundle/Entity/Usergroup.php
  8. 12
      src/CoreBundle/Repository/TrackECourseAccessRepository.php
  9. 7
      src/CourseBundle/Entity/CAnnouncement.php
  10. 10
      src/CourseBundle/Entity/CAttendance.php
  11. 2
      src/CourseBundle/Entity/CForumForum.php
  12. 5
      src/CourseBundle/Entity/CForumPost.php
  13. 2
      src/CourseBundle/Entity/CGroup.php
  14. 20
      src/CourseBundle/Entity/CGroupCategory.php
  15. 10
      src/CourseBundle/Entity/CLp.php
  16. 28
      src/CourseBundle/Entity/CQuizAnswer.php
  17. 2
      src/CourseBundle/Entity/CThematicAdvance.php

@ -43,6 +43,8 @@ class AccessUrl extends AbstractResource implements ResourceInterface
protected $courses;
/**
* @var ArrayCollection|AccessUrlRelSession[]
*
* @ORM\OneToMany(targetEntity="AccessUrlRelSession", mappedBy="url", cascade={"persist"}, orphanRemoval=true)
*/
protected $sessions;

@ -52,9 +52,6 @@ class CourseRelUserCatalogue
*/
protected $visible;
/**
* Constructor.
*/
public function __construct()
{
}
@ -98,7 +95,7 @@ class CourseRelUserCatalogue
/**
* Set visible.
*
* @param bool $visible
* @param int $visible
*/
public function setVisible($visible): self
{
@ -110,7 +107,7 @@ class CourseRelUserCatalogue
/**
* Get visible.
*
* @return bool
* @return int
*/
public function getVisible()
{

@ -76,20 +76,12 @@ class ExtraFieldValues
return $this;
}
/**
* @return string
*/
public function getItemId()
public function getItemId(): int
{
return $this->itemId;
}
/**
* @param string $itemId
*
* @return ExtraFieldValues
*/
public function setItemId($itemId)
public function setItemId(int $itemId): self
{
$this->itemId = $itemId;

@ -348,12 +348,7 @@ class Session
return $this->showDescription;
}
/**
* @param string $showDescription
*
* @return $this
*/
public function setShowDescription($showDescription)
public function setShowDescription($showDescription): self
{
$this->showDescription = $showDescription;

@ -59,21 +59,17 @@ class SessionRelUser
protected int $duration;
/**
* @var int
*
* @ORM\Column(name="moved_to", type="integer", nullable=true, unique=false)
*/
protected $movedTo;
protected ?int $movedTo;
/**
* @var int
*
* @ORM\Column(name="moved_status", type="integer", nullable=true, unique=false)
*/
protected $movedStatus;
protected ?int $movedStatus;
/**
* @var \DateTime
* @var \DateTime|null
*
* @ORM\Column(name="moved_at", type="datetime", nullable=true, unique=false)
*/
@ -91,7 +87,6 @@ class SessionRelUser
$this->duration = 0;
$this->movedTo = null;
$this->movedStatus = null;
$this->movedAt = null;
$this->registeredAt = new \DateTime('now', new \DateTimeZone('UTC'));
}

@ -126,17 +126,14 @@ class SysAnnouncement
*/
protected $promotionId;
/**
* SysAnnouncement constructor.
*/
public function __construct()
{
$this->visibleBoss = 0;
$this->visibleDrh = 0;
$this->visibleGuest = 0;
$this->visibleSessionAdmin = 0;
$this->visibleStudent = 0;
$this->visibleTeacher = 0;
$this->visibleBoss = false;
$this->visibleDrh = false;
$this->visibleGuest = false;
$this->visibleSessionAdmin = false;
$this->visibleStudent = false;
$this->visibleTeacher = false;
$this->careerId = 0;
$this->promotionId = 0;
}

@ -85,7 +85,7 @@ class Usergroup extends AbstractResource implements ResourceInterface, ResourceI
protected $allowMembersToLeaveGroup;
/**
* @var UsergroupRelUser[]
* @var ArrayCollection|UsergroupRelUser[]
* @ORM\OneToMany(targetEntity="UsergroupRelUser", mappedBy="usergroup", cascade={"persist"}, orphanRemoval=true)
*/
protected $users;

@ -16,9 +16,6 @@ use Doctrine\Persistence\ManagerRegistry;
*/
class TrackECourseAccessRepository extends ServiceEntityRepository
{
/**
* TrackECourseAccessRepository constructor.
*/
public function __construct(ManagerRegistry $registry)
{
parent::__construct($registry, TrackECourseAccess::class);
@ -26,15 +23,10 @@ class TrackECourseAccessRepository extends ServiceEntityRepository
/**
* Get the last registered access by an user.
*
* @param User $user The user
*
* @return TrackECourseAccess The access if exists.
* Otherwise return null
*/
public function getLastAccessByUser(User $user)
public function getLastAccessByUser(User $user = null): ?TrackECourseAccess
{
if (empty($user)) {
if (null === $user) {
return null;
}

@ -61,7 +61,7 @@ class CAnnouncement extends AbstractResource implements ResourceInterface
protected $emailSent;
/**
* @var ArrayCollection|CAnnouncementAttachment[]
* @var ArrayCollection<int, CAnnouncementAttachment>
*
* @ORM\OneToMany(
* targetEntity="CAnnouncementAttachment",
@ -86,10 +86,7 @@ class CAnnouncement extends AbstractResource implements ResourceInterface
return $this->attachments;
}
/**
* @param CAnnouncementAttachment[] $attachments
*/
public function setAttachments(array $attachments): self
public function setAttachments($attachments): self
{
$this->attachments = $attachments;

@ -75,7 +75,7 @@ class CAttendance extends AbstractResource implements ResourceInterface
protected int $locked;
/**
* @var CAttendanceCalendar[]
* @var ArrayCollection|CAttendanceCalendar[]
*
* @ORM\OneToMany(
* targetEntity="CAttendanceCalendar", mappedBy="attendance", cascade={"persist", "remove"}, orphanRemoval=true
@ -246,18 +246,12 @@ class CAttendance extends AbstractResource implements ResourceInterface
return $this->iid;
}
/**
* @return CAttendanceCalendar[]|ArrayCollection
*/
public function getCalendars()
{
return $this->calendars;
}
/**
* @param CAttendanceCalendar[] $calendars
*/
public function setCalendars(array $calendars): self
public function setCalendars($calendars): self
{
$this->calendars = $calendars;

@ -215,7 +215,7 @@ class CForumForum extends AbstractResource implements ResourceInterface
$this->locked = 0;
$this->forumComment = '';
$this->forumImage = '';
$this->forumOfGroup = 0;
$this->forumOfGroup = '';
$this->forumPosts = 0;
$this->forumGroupPublicPrivate = '';
}

@ -94,7 +94,7 @@ class CForumPost extends AbstractResource implements ResourceInterface
protected $postNotification;
/**
* @var int
* @var int|null
*
* @ORM\Column(name="post_parent_id", type="integer", nullable=true)
*/
@ -344,9 +344,6 @@ class CForumPost extends AbstractResource implements ResourceInterface
return $this->iid;
}
/**
* @return CForumAttachment[]
*/
public function getAttachments()
{
return $this->attachments;

@ -167,7 +167,7 @@ class CGroup extends AbstractResource implements ResourceInterface
public function __construct()
{
$this->status = 1;
$this->status = true;
$this->members = new ArrayCollection();
$this->tutors = new ArrayCollection();
}

@ -130,17 +130,17 @@ class CGroupCategory extends AbstractResource implements ResourceInterface
{
$this->maxStudent = 0;
$this->description = '';
$this->selfRegAllowed = 0;
$this->selfUnregAllowed = 0;
$this->selfRegAllowed = false;
$this->selfUnregAllowed = false;
$this->groupsPerUser = 0;
$this->announcementsState = 1;
$this->calendarState = 1;
$this->documentAccess = 1;
$this->chatState = 1;
$this->docState = 1;
$this->forumState = 1;
$this->wikiState = 1;
$this->workState = 1;
$this->announcementsState = true;
$this->calendarState = true;
$this->documentAccess = 0;
$this->chatState = true;
$this->docState = true;
$this->forumState = true;
$this->wikiState = true;
$this->workState = true;
}
public function __toString(): string

@ -269,7 +269,7 @@ class CLp extends AbstractResource implements ResourceInterface
protected $accumulateWorkTime;
/**
* @var CLpItem[]
* @var ArrayCollection|CLpItem[]
*
* @ORM\OneToMany(targetEntity="CLpItem", mappedBy="lp", cascade={"persist", "remove"}, orphanRemoval=true)
*/
@ -305,15 +305,15 @@ class CLp extends AbstractResource implements ResourceInterface
$this->defaultViewMod = 'embedded';
$this->description = '';
$this->displayOrder = 0;
$this->debug = 0;
$this->forceCommit = 0;
$this->hideTocFrame = 0;
$this->debug = false;
$this->forceCommit = false;
$this->hideTocFrame = false;
$this->jsLib = '';
$this->maxAttempts = 0;
$this->preventReinit = true;
$this->path = '';
$this->prerequisite = 0;
$this->seriousgameMode = 0;
$this->seriousgameMode = false;
$this->subscribeUsers = 0;
$this->useMaxScore = 1;
$this->theme = '';

@ -51,18 +51,14 @@ class CQuizAnswer
protected string $answer;
/**
* @var int
*
* @ORM\Column(name="correct", type="integer", nullable=true)
*/
protected $correct;
protected ?int $correct;
/**
* @var string
*
* @ORM\Column(name="comment", type="text", nullable=true)
*/
protected $comment;
protected ?string $comment;
/**
* @var float
@ -72,39 +68,29 @@ class CQuizAnswer
protected $ponderation;
/**
* @var int
*
* @ORM\Column(name="position", type="integer", nullable=false)
*/
protected $position;
protected int $position;
/**
* @var string
*
* @ORM\Column(name="hotspot_coordinates", type="text", nullable=true)
*/
protected $hotspotCoordinates;
protected ?string $hotspotCoordinates;
/**
* @var string
*
* @ORM\Column(name="hotspot_type", type="string", length=40, nullable=true)
*/
protected $hotspotType;
protected ?string $hotspotType;
/**
* @var string
*
* @ORM\Column(name="destination", type="text", nullable=true)
*/
protected $destination;
protected ?string $destination;
/**
* @var string
*
* @ORM\Column(name="answer_code", type="string", length=10, nullable=true)
*/
protected $answerCode;
protected ?string $answerCode;
public function __construct()
{

@ -78,7 +78,7 @@ class CThematicAdvance //extends AbstractResource implements ResourceInterface
public function __construct()
{
$this->doneAdvance = 0;
$this->doneAdvance = false;
$this->duration = 1;
}

Loading…
Cancel
Save