Fix entity annotations, add migrations, fix type hints

pull/3844/head
Julio Montoya 5 years ago
parent 7e9594fa2b
commit 751874e559
  1. 7
      src/CoreBundle/Entity/Language.php
  2. 20
      src/CoreBundle/Entity/Level.php
  3. 35
      src/CoreBundle/Entity/MessageAttachment.php
  4. 32
      src/CoreBundle/Entity/Room.php
  5. 38
      src/CoreBundle/Entity/SessionRelUser.php
  6. 42
      src/CoreBundle/Entity/SettingsCurrent.php
  7. 21
      src/CoreBundle/Entity/SettingsOptions.php
  8. 5
      src/CoreBundle/Entity/Skill.php
  9. 116
      src/CoreBundle/Entity/SysAnnouncement.php
  10. 52
      src/CoreBundle/Entity/SysCalendar.php
  11. 28
      src/CoreBundle/Entity/SystemTemplate.php
  12. 2
      src/CourseBundle/Repository/CDocumentRepository.php
  13. 8
      src/CourseBundle/Repository/CForumPostRepository.php
  14. 4
      src/CourseBundle/Repository/CStudentPublicationRepository.php

@ -71,12 +71,7 @@ class Language
$this->subLanguages = new ArrayCollection();
}
/**
* Set originalName.
*
* @return Language
*/
public function setOriginalName(string $originalName)
public function setOriginalName(string $originalName): self
{
$this->originalName = $originalName;

@ -73,10 +73,7 @@ class Level
return $this->name;
}
/**
* @return Level
*/
public function setName(string $name)
public function setName(string $name): self
{
$this->name = $name;
@ -88,10 +85,7 @@ class Level
return $this->position;
}
/**
* @return Level
*/
public function setPosition(int $position)
public function setPosition(int $position): self
{
$this->position = $position;
@ -103,10 +97,7 @@ class Level
return $this->shortName;
}
/**
* @return Level
*/
public function setShortName(string $shortName)
public function setShortName(string $shortName): self
{
$this->shortName = $shortName;
@ -121,10 +112,7 @@ class Level
return $this->profile;
}
/**
* @return Level
*/
public function setProfile(Profile $profile)
public function setProfile(Profile $profile): self
{
$this->profile = $profile;

@ -54,12 +54,7 @@ class MessageAttachment extends AbstractResource implements ResourceInterface
return $this->getFilename();
}
/**
* Set path.
*
* @return MessageAttachment
*/
public function setPath(string $path)
public function setPath(string $path): self
{
$this->path = $path;
@ -76,12 +71,7 @@ class MessageAttachment extends AbstractResource implements ResourceInterface
return $this->path;
}
/**
* Set comment.
*
* @return MessageAttachment
*/
public function setComment(string $comment)
public function setComment(string $comment): self
{
$this->comment = $comment;
@ -98,12 +88,7 @@ class MessageAttachment extends AbstractResource implements ResourceInterface
return $this->comment;
}
/**
* Set size.
*
* @return MessageAttachment
*/
public function setSize(int $size)
public function setSize(int $size): self
{
$this->size = $size;
@ -120,12 +105,7 @@ class MessageAttachment extends AbstractResource implements ResourceInterface
return $this->size;
}
/**
* Set message.
*
* @return MessageAttachment
*/
public function setMessage(Message $message)
public function setMessage(Message $message): self
{
$this->message = $message;
@ -142,12 +122,7 @@ class MessageAttachment extends AbstractResource implements ResourceInterface
return $this->message;
}
/**
* Set filename.
*
* @return MessageAttachment
*/
public function setFilename(string $filename)
public function setFilename(string $filename): self
{
$this->filename = $filename;

@ -66,12 +66,7 @@ class Room
return $this->id;
}
/**
* Set title.
*
* @return $this
*/
public function setTitle(string $title)
public function setTitle(string $title): self
{
$this->title = $title;
@ -96,10 +91,7 @@ class Room
return $this->description;
}
/**
* @return Room
*/
public function setDescription(string $description)
public function setDescription(string $description): self
{
$this->description = $description;
@ -114,10 +106,7 @@ class Room
return $this->geolocation;
}
/**
* @return Room
*/
public function setGeolocation(string $geolocation)
public function setGeolocation(string $geolocation): self
{
$this->geolocation = $geolocation;
@ -132,10 +121,7 @@ class Room
return $this->ip;
}
/**
* @return Room
*/
public function setIp(string $ip)
public function setIp(string $ip): self
{
$this->ip = $ip;
@ -150,10 +136,7 @@ class Room
return $this->ipMask;
}
/**
* @return Room
*/
public function setIpMask(string $ipMask)
public function setIpMask(string $ipMask): self
{
$this->ipMask = $ipMask;
@ -168,10 +151,7 @@ class Room
return $this->branch;
}
/**
* @return $this
*/
public function setBranch(BranchSync $branch)
public function setBranch(BranchSync $branch): self
{
$this->branch = $branch;

@ -110,11 +110,6 @@ class SessionRelUser
return $this;
}
/**
* Set relationTypeByName.
*
* @return SessionRelUser
*/
public function setRelationTypeByName(string $relationType): self
{
if (isset($this->relationTypeList[$relationType])) {
@ -129,12 +124,7 @@ class SessionRelUser
return $this->relationType;
}
/**
* Set movedTo.
*
* @return SessionRelUser
*/
public function setMovedTo(int $movedTo)
public function setMovedTo(int $movedTo): self
{
$this->movedTo = $movedTo;
@ -151,12 +141,7 @@ class SessionRelUser
return $this->movedTo;
}
/**
* Set movedStatus.
*
* @return SessionRelUser
*/
public function setMovedStatus(int $movedStatus)
public function setMovedStatus(int $movedStatus): self
{
$this->movedStatus = $movedStatus;
@ -173,12 +158,7 @@ class SessionRelUser
return $this->movedStatus;
}
/**
* Set movedAt.
*
* @return SessionRelUser
*/
public function setMovedAt(DateTime $movedAt)
public function setMovedAt(DateTime $movedAt): self
{
$this->movedAt = $movedAt;
@ -195,12 +175,7 @@ class SessionRelUser
return $this->movedAt;
}
/**
* Set registeredAt.
*
* @return $this
*/
public function setRegisteredAt(DateTime $registeredAt)
public function setRegisteredAt(DateTime $registeredAt): self
{
$this->registeredAt = $registeredAt;
@ -225,10 +200,7 @@ class SessionRelUser
return $this->duration;
}
/**
* @return SessionRelUser
*/
public function setDuration(int $duration)
public function setDuration(int $duration): self
{
$this->duration = $duration;

@ -105,12 +105,7 @@ class SettingsCurrent
$this->accessUrlLocked = 0;
}
/**
* Set variable.
*
* @return SettingsCurrent
*/
public function setVariable(string $variable)
public function setVariable(string $variable): self
{
$this->variable = $variable;
@ -127,12 +122,7 @@ class SettingsCurrent
return $this->variable;
}
/**
* Set subkey.
*
* @return SettingsCurrent
*/
public function setSubkey(string $subkey)
public function setSubkey(string $subkey): self
{
$this->subkey = $subkey;
@ -149,12 +139,7 @@ class SettingsCurrent
return $this->subkey;
}
/**
* Set type.
*
* @return SettingsCurrent
*/
public function setType(string $type)
public function setType(string $type): self
{
$this->type = $type;
@ -188,12 +173,7 @@ class SettingsCurrent
return $this->category;
}
/**
* Set selectedValue.
*
* @return SettingsCurrent
*/
public function setSelectedValue(?string $selectedValue)
public function setSelectedValue(?string $selectedValue): self
{
$this->selectedValue = $selectedValue;
@ -210,12 +190,7 @@ class SettingsCurrent
return $this->selectedValue;
}
/**
* Set title.
*
* @return SettingsCurrent
*/
public function setTitle(string $title)
public function setTitle(string $title): self
{
$this->title = $title;
@ -232,12 +207,7 @@ class SettingsCurrent
return $this->title;
}
/**
* Set comment.
*
* @return SettingsCurrent
*/
public function setComment(string $comment)
public function setComment(string $comment): self
{
$this->comment = $comment;

@ -44,12 +44,7 @@ class SettingsOptions
*/
protected string $displayText;
/**
* Set variable.
*
* @return SettingsOptions
*/
public function setVariable(string $variable)
public function setVariable(string $variable): self
{
$this->variable = $variable;
@ -66,12 +61,7 @@ class SettingsOptions
return $this->variable;
}
/**
* Set value.
*
* @return SettingsOptions
*/
public function setValue(string $value)
public function setValue(string $value): self
{
$this->value = $value;
@ -88,12 +78,7 @@ class SettingsOptions
return $this->value;
}
/**
* Set displayText.
*
* @return SettingsOptions
*/
public function setDisplayText(string $displayText)
public function setDisplayText(string $displayText): self
{
$this->displayText = $displayText;

@ -382,10 +382,7 @@ class Skill
return $this;
}
/**
* @return bool
*/
public function hasItem($typeId, int $itemId)
public function hasItem(int $typeId, int $itemId): bool
{
if (0 !== $this->getItems()->count()) {
$found = false;

@ -85,9 +85,10 @@ class SysAnnouncement
protected ?string $lang = null;
/**
* @ORM\Column(name="access_url_id", type="integer", nullable=false)
* @ORM\ManyToOne(targetEntity="AccessUrl")
* @ORM\JoinColumn(name="access_url_id", referencedColumnName="id", onDelete="CASCADE")
*/
protected int $accessUrlId;
protected AccessUrl $url;
/**
* @ORM\Column(name="career_id", type="integer", nullable=true)
@ -111,18 +112,6 @@ class SysAnnouncement
$this->promotionId = 0;
}
/**
* Set dateStart.
*
* @return SysAnnouncement
*/
public function setDateStart(DateTime $dateStart)
{
$this->dateStart = $dateStart;
return $this;
}
/**
* Get dateStart.
*
@ -133,14 +122,9 @@ class SysAnnouncement
return $this->dateStart;
}
/**
* Set dateEnd.
*
* @return SysAnnouncement
*/
public function setDateEnd(DateTime $dateEnd)
public function setDateStart(DateTime $dateStart): self
{
$this->dateEnd = $dateEnd;
$this->dateStart = $dateStart;
return $this;
}
@ -155,14 +139,9 @@ class SysAnnouncement
return $this->dateEnd;
}
/**
* Set visibleTeacher.
*
* @return SysAnnouncement
*/
public function setVisibleTeacher(bool $visibleTeacher)
public function setDateEnd(DateTime $dateEnd): self
{
$this->visibleTeacher = $visibleTeacher;
$this->dateEnd = $dateEnd;
return $this;
}
@ -177,14 +156,9 @@ class SysAnnouncement
return $this->visibleTeacher;
}
/**
* Set visibleStudent.
*
* @return SysAnnouncement
*/
public function setVisibleStudent(bool $visibleStudent)
public function setVisibleTeacher(bool $visibleTeacher): self
{
$this->visibleStudent = $visibleStudent;
$this->visibleTeacher = $visibleTeacher;
return $this;
}
@ -199,14 +173,9 @@ class SysAnnouncement
return $this->visibleStudent;
}
/**
* Set visibleGuest.
*
* @return SysAnnouncement
*/
public function setVisibleGuest(bool $visibleGuest)
public function setVisibleStudent(bool $visibleStudent): self
{
$this->visibleGuest = $visibleGuest;
$this->visibleStudent = $visibleStudent;
return $this;
}
@ -221,14 +190,9 @@ class SysAnnouncement
return $this->visibleGuest;
}
/**
* Set title.
*
* @return SysAnnouncement
*/
public function setTitle(string $title)
public function setVisibleGuest(bool $visibleGuest): self
{
$this->title = $title;
$this->visibleGuest = $visibleGuest;
return $this;
}
@ -243,14 +207,9 @@ class SysAnnouncement
return $this->title;
}
/**
* Set content.
*
* @return SysAnnouncement
*/
public function setContent(string $content)
public function setTitle(string $title): self
{
$this->content = $content;
$this->title = $title;
return $this;
}
@ -265,14 +224,9 @@ class SysAnnouncement
return $this->content;
}
/**
* Set lang.
*
* @return SysAnnouncement
*/
public function setLang(string $lang)
public function setContent(string $content): self
{
$this->lang = $lang;
$this->content = $content;
return $this;
}
@ -287,28 +241,13 @@ class SysAnnouncement
return $this->lang;
}
/**
* Set accessUrlId.
*
* @return SysAnnouncement
*/
public function setAccessUrlId(int $accessUrlId)
public function setLang(string $lang): self
{
$this->accessUrlId = $accessUrlId;
$this->lang = $lang;
return $this;
}
/**
* Get accessUrlId.
*
* @return int
*/
public function getAccessUrlId()
{
return $this->accessUrlId;
}
/**
* Get id.
*
@ -336,9 +275,8 @@ class SysAnnouncement
return $this->visibleSessionAdmin;
}
public function setVisibleSessionAdmin(
bool $visibleSessionAdmin
): self {
public function setVisibleSessionAdmin(bool $visibleSessionAdmin): self
{
$this->visibleSessionAdmin = $visibleSessionAdmin;
return $this;
@ -355,4 +293,16 @@ class SysAnnouncement
return $this;
}
public function getUrl(): AccessUrl
{
return $this->url;
}
public function setUrl(AccessUrl $url): self
{
$this->url = $url;
return $this;
}
}

@ -45,20 +45,16 @@ class SysCalendar
protected ?DateTime $endDate = null;
/**
* @ORM\Column(name="access_url_id", type="integer", nullable=false)
* @ORM\ManyToOne(targetEntity="AccessUrl")
* @ORM\JoinColumn(name="access_url_id", referencedColumnName="id", onDelete="CASCADE")
*/
protected int $accessUrlId;
protected AccessUrl $url;
/**
* @ORM\Column(name="all_day", type="integer", nullable=false)
*/
protected int $allDay;
/**
* Set title.
*
* @return SysCalendar
*/
public function setTitle(string $title): self
{
$this->title = $title;
@ -76,11 +72,6 @@ class SysCalendar
return $this->title;
}
/**
* Set content.
*
* @return SysCalendar
*/
public function setContent(string $content): self
{
$this->content = $content;
@ -98,11 +89,6 @@ class SysCalendar
return $this->content;
}
/**
* Set startDate.
*
* @return SysCalendar
*/
public function setStartDate(DateTime $startDate): self
{
$this->startDate = $startDate;
@ -120,11 +106,6 @@ class SysCalendar
return $this->startDate;
}
/**
* Set endDate.
*
* @return SysCalendar
*/
public function setEndDate(DateTime $endDate): self
{
$this->endDate = $endDate;
@ -142,33 +123,6 @@ class SysCalendar
return $this->endDate;
}
/**
* Set accessUrlId.
*
* @return SysCalendar
*/
public function setAccessUrlId(int $accessUrlId): self
{
$this->accessUrlId = $accessUrlId;
return $this;
}
/**
* Get accessUrlId.
*
* @return int
*/
public function getAccessUrlId()
{
return $this->accessUrlId;
}
/**
* Set allDay.
*
* @return SysCalendar
*/
public function setAllDay(int $allDay): self
{
$this->allDay = $allDay;

@ -48,12 +48,7 @@ class SystemTemplate
$this->comment = '';
}
/**
* Set title.
*
* @return SystemTemplate
*/
public function setTitle(string $title)
public function setTitle(string $title): self
{
$this->title = $title;
@ -70,12 +65,7 @@ class SystemTemplate
return $this->title;
}
/**
* Set comment.
*
* @return SystemTemplate
*/
public function setComment(string $comment)
public function setComment(string $comment): self
{
$this->comment = $comment;
@ -92,12 +82,7 @@ class SystemTemplate
return $this->comment;
}
/**
* Set image.
*
* @return SystemTemplate
*/
public function setImage(string $image)
public function setImage(string $image): self
{
$this->image = $image;
@ -114,12 +99,7 @@ class SystemTemplate
return $this->image;
}
/**
* Set content.
*
* @return SystemTemplate
*/
public function setContent(string $content)
public function setContent(string $content): self
{
$this->content = $content;

@ -122,7 +122,7 @@ final class CDocumentRepository extends ResourceRepository implements GridInterf
return $query->getResult();
}
public function countUserDocuments(User $user, Course $course, Session $session = null, CGroup $group = null)
public function countUserDocuments(User $user, Course $course, Session $session = null, CGroup $group = null): int
{
$qb = $this->getResourcesByCourseLinkedToUser($user, $course, $session, $group);

@ -23,18 +23,18 @@ class CForumPostRepository extends ResourceRepository
parent::__construct($registry, CForumPost::class);
}
public function countUserForumPosts(User $user, Course $course, Session $session = null)
public function countCourseForumPosts(Course $course, Session $session = null): int
{
$qb = $this->getResourcesByCourseLinkedToUser($user, $course, $session);
$qb = $this->getResourcesByCourse($course, $session);
$qb->select('count(resource)');
return $qb->getQuery()->getSingleScalarResult();
}
public function countCourseForumPosts(Course $course, Session $session = null)
public function countUserForumPosts(User $user, Course $course, Session $session = null): int
{
$qb = $this->getResourcesByCourse($course, $session);
$qb = $this->getResourcesByCourseLinkedToUser($user, $course, $session);
$qb->select('count(resource)');

@ -58,7 +58,7 @@ final class CStudentPublicationRepository extends ResourceRepository
return $qb;
}
public function countUserPublications(User $user, Course $course, Session $session = null, CGroup $group = null)
public function countUserPublications(User $user, Course $course, Session $session = null, CGroup $group = null): int
{
$qb = $this->getResourcesByCourseLinkedToUser($user, $course, $session);
@ -67,7 +67,7 @@ final class CStudentPublicationRepository extends ResourceRepository
return $qb->getQuery()->getSingleScalarResult();
}
public function countCoursePublications(Course $course, Session $session = null, CGroup $group = null)
public function countCoursePublications(Course $course, Session $session = null, CGroup $group = null): int
{
$qb = $this->getResourcesByCourse($course, $session, $group);

Loading…
Cancel
Save