Minor - format code

pull/3425/head
Julio Montoya 5 years ago
parent d55312762e
commit 297d497149
  1. 14
      plugin/zoom/Entity/MeetingEntity.php
  2. 14
      plugin/zoom/Entity/RecordingEntity.php
  3. 22
      plugin/zoom/Entity/RegistrantEntity.php
  4. 2
      plugin/zoom/lib/API/MeetingInfoGet.php
  5. 8
      plugin/zoom/lib/ZoomPlugin.php

@ -64,33 +64,27 @@ class MeetingEntity
/** /**
* @var int the remote zoom meeting identifier * @var int the remote zoom meeting identifier
* @ORM\Column(type="string") * @ORM\Column(name="meeting_id", type="string")
*/ */
protected $meetingId; protected $meetingId;
/** /**
* @var User * @var User
* @ORM\ManyToOne( * @ORM\ManyToOne(targetEntity="Chamilo\UserBundle\Entity\User")
* targetEntity="Chamilo\UserBundle\Entity\User",
* )
* @ORM\JoinColumn(name="user_id", nullable=true) * @ORM\JoinColumn(name="user_id", nullable=true)
*/ */
protected $user; protected $user;
/** /**
* @var Course * @var Course
* @ORM\ManyToOne( * @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\Course")
* targetEntity="Chamilo\CoreBundle\Entity\Course",
* )
* @ORM\JoinColumn(name="course_id", nullable=true) * @ORM\JoinColumn(name="course_id", nullable=true)
*/ */
protected $course; protected $course;
/** /**
* @var Session * @var Session
* @ORM\ManyToOne( * @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\Session")
* targetEntity="Chamilo\CoreBundle\Entity\Session",
* )
* @ORM\JoinColumn(name="session_id", nullable=true) * @ORM\JoinColumn(name="session_id", nullable=true)
*/ */
protected $session; protected $session;

@ -44,13 +44,13 @@ class RecordingEntity
* @ORM\Id * @ORM\Id
* @ORM\GeneratedValue() * @ORM\GeneratedValue()
*/ */
private $id; protected $id;
/** /**
* @var string * @var string
* @ORM\Column(type="string") * @ORM\Column(type="string")
*/ */
private $uuid; protected $uuid;
/** /**
* @var MeetingEntity * @var MeetingEntity
@ -60,16 +60,16 @@ class RecordingEntity
* ) * )
* @ORM\JoinColumn(name="meeting_id") * @ORM\JoinColumn(name="meeting_id")
*/ */
private $meeting; protected $meeting;
/** /**
* @var string * @var string
* @ORM\Column(type="text", name="recording_meeting_json", nullable=true) * @ORM\Column(type="text", name="recording_meeting_json", nullable=true)
*/ */
private $recordingMeetingJson; protected $recordingMeetingJson;
/** @var RecordingMeeting */ /** @var RecordingMeeting */
private $recordingMeeting; protected $recordingMeeting;
/** /**
* @param $name * @param $name
@ -142,8 +142,8 @@ class RecordingEntity
} }
if (null === $this->meeting) { if (null === $this->meeting) {
$this->meeting = Database::getManager()->getRepository(MeetingEntity::class)->find($recordingMeeting->id); $this->meeting = Database::getManager()->getRepository(MeetingEntity::class)->find($recordingMeeting->id);
// $this->meeting remains null when the remote RecordingMeeting refers to a deleted meeting
} elseif ($this->meeting->getId() != $recordingMeeting->id) { } elseif ($this->meeting->getId() != $recordingMeeting->id) {
// $this->meeting remains null when the remote RecordingMeeting refers to a deleted meeting.
throw new Exception('The RecordingEntity meeting id differs from the RecordingMeeting meeting id'); throw new Exception('The RecordingEntity meeting id differs from the RecordingMeeting meeting id');
} }
$this->recordingMeeting = $recordingMeeting; $this->recordingMeeting = $recordingMeeting;
@ -169,7 +169,7 @@ class RecordingEntity
*/ */
public function preFlush() public function preFlush()
{ {
if (!is_null($this->recordingMeeting)) { if (null !== $this->recordingMeeting) {
$this->recordingMeetingJson = json_encode($this->recordingMeeting); $this->recordingMeetingJson = json_encode($this->recordingMeeting);
} }
} }

@ -35,16 +35,14 @@ class RegistrantEntity
* @ORM\Id * @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO") * @ORM\GeneratedValue(strategy="AUTO")
*/ */
private $id; protected $id;
/** /**
* @var User * @var User
* @ORM\ManyToOne( * @ORM\ManyToOne(targetEntity="Chamilo\UserBundle\Entity\User")
* targetEntity="Chamilo\UserBundle\Entity\User",
* )
* @ORM\JoinColumn(name="user_id", nullable=false) * @ORM\JoinColumn(name="user_id", nullable=false)
*/ */
private $user; protected $user;
/** /**
* @var MeetingEntity * @var MeetingEntity
@ -54,34 +52,34 @@ class RegistrantEntity
* ) * )
* @ORM\JoinColumn(name="meeting_id") * @ORM\JoinColumn(name="meeting_id")
*/ */
private $meeting; protected $meeting;
/** /**
* @var string * @var string
* @ORM\Column(type="text", name="created_registration_json", nullable=true) * @ORM\Column(type="text", name="created_registration_json", nullable=true)
*/ */
private $createdRegistrationJson; protected $createdRegistrationJson;
/** /**
* @var string * @var string
* @ORM\Column(type="text", name="meeting_registrant_list_item_json", nullable=true) * @ORM\Column(type="text", name="meeting_registrant_list_item_json", nullable=true)
*/ */
private $meetingRegistrantListItemJson; protected $meetingRegistrantListItemJson;
/** /**
* @var string * @var string
* @ORM\Column(type="text", name="meeting_registrant_json", nullable=true) * @ORM\Column(type="text", name="meeting_registrant_json", nullable=true)
*/ */
private $meetingRegistrantJson; protected $meetingRegistrantJson;
/** @var CreatedRegistration */ /** @var CreatedRegistration */
private $createdRegistration; protected $createdRegistration;
/** @var MeetingRegistrant */ /** @var MeetingRegistrant */
private $meetingRegistrant; protected $meetingRegistrant;
/** @var MeetingRegistrantListItem */ /** @var MeetingRegistrantListItem */
private $meetingRegistrantListItem; protected $meetingRegistrantListItem;
/** /**
* @return string * @return string

@ -8,7 +8,7 @@ use Exception;
/** /**
* Class MeetingInfoGet * Class MeetingInfoGet
* Full Meeting as returned by the server, with unique identifiers and current status. * * Full Meeting as returned by the server, with unique identifiers and current status.
*/ */
class MeetingInfoGet extends MeetingInfo class MeetingInfoGet extends MeetingInfo
{ {

@ -738,7 +738,7 @@ class ZoomPlugin extends Plugin
public function createLinkToFileInCourse($meeting, $file, $name) public function createLinkToFileInCourse($meeting, $file, $name)
{ {
$course = $meeting->getCourse(); $course = $meeting->getCourse();
if (is_null($course)) { if (null === $course) {
throw new Exception('This meeting is not linked to a course'); throw new Exception('This meeting is not linked to a course');
} }
$courseInfo = api_get_course_info_by_id($course->getId()); $courseInfo = api_get_course_info_by_id($course->getId());
@ -764,7 +764,7 @@ class ZoomPlugin extends Plugin
public function copyFileToCourse($meeting, $file, $name) public function copyFileToCourse($meeting, $file, $name)
{ {
$course = $meeting->getCourse(); $course = $meeting->getCourse();
if (is_null($course)) { if (null === $course) {
throw new Exception('This meeting is not linked to a course'); throw new Exception('This meeting is not linked to a course');
} }
$courseInfo = api_get_course_info_by_id($course->getId()); $courseInfo = api_get_course_info_by_id($course->getId());
@ -901,10 +901,10 @@ class ZoomPlugin extends Plugin
{ {
foreach (RecordingList::loadPeriodRecordings($startDate, $endDate) as $recordingMeeting) { foreach (RecordingList::loadPeriodRecordings($startDate, $endDate) as $recordingMeeting) {
$recordingEntity = $this->getRecordingRepository()->find($recordingMeeting->uuid); $recordingEntity = $this->getRecordingRepository()->find($recordingMeeting->uuid);
if (is_null($recordingEntity)) { if (null === $recordingEntity) {
$recordingEntity = new RecordingEntity(); $recordingEntity = new RecordingEntity();
$meetingEntity = $this->getMeetingRepository()->find($recordingMeeting->id); $meetingEntity = $this->getMeetingRepository()->find($recordingMeeting->id);
if (is_null($meetingEntity)) { if (null === $meetingEntity) {
try { try {
$meetingInfoGet = MeetingInfoGet::fromId($recordingMeeting->id); $meetingInfoGet = MeetingInfoGet::fromId($recordingMeeting->id);
} catch (Exception $exception) { } catch (Exception $exception) {

Loading…
Cancel
Save