From 536b81e77dce3c86089436688753262867cdd1c2 Mon Sep 17 00:00:00 2001 From: Sebastian Marcet Date: Tue, 8 May 2018 10:55:05 -0300 Subject: [PATCH] Refactored Presentation Object Mapping Removed fields * LightningTalk * FeatureCloud Added field * AttendingMedia Change-Id: I976d0b29d5bd0af0d72175522cc76160697cf90b --- .../Presentation/PresentationSerializer.php | 4 +-- .../Events/Presentations/Presentation.php | 25 ++++++++++--------- app/Services/Model/SummitService.php | 5 ++-- 3 files changed, 18 insertions(+), 16 deletions(-) diff --git a/app/ModelSerializers/Summit/Presentation/PresentationSerializer.php b/app/ModelSerializers/Summit/Presentation/PresentationSerializer.php index 9c5e3a78..9d9f960c 100644 --- a/app/ModelSerializers/Summit/Presentation/PresentationSerializer.php +++ b/app/ModelSerializers/Summit/Presentation/PresentationSerializer.php @@ -25,7 +25,7 @@ class PresentationSerializer extends SummitEventSerializer 'ProblemAddressed' => 'problem_addressed:json_string', 'AttendeesExpectedLearnt' => 'attendees_expected_learnt:json_string', 'ToRecord' => 'to_record:json_boolean', - 'FeatureCloud' => 'feature_cloud:json_boolean', + 'AttendingMedia' => 'attending_media:json_boolean', 'StatusNice' => 'status:json_string', ]; @@ -37,7 +37,7 @@ class PresentationSerializer extends SummitEventSerializer 'problem_addressed', 'attendees_expected_learnt', 'to_record', - 'feature_cloud', + 'attending_media', 'status', ]; diff --git a/app/Models/Foundation/Summit/Events/Presentations/Presentation.php b/app/Models/Foundation/Summit/Events/Presentations/Presentation.php index 54376a60..63db5fa5 100644 --- a/app/Models/Foundation/Summit/Events/Presentations/Presentation.php +++ b/app/Models/Foundation/Summit/Events/Presentations/Presentation.php @@ -104,10 +104,10 @@ class Presentation extends SummitEvent protected $to_record; /** - * @ORM\Column(name="FeatureCloud", type="boolean") + * @ORM\Column(name="AttendingMedia", type="boolean") * @var bool */ - protected $feature_cloud; + protected $attending_media; /** * @ORM\ManyToOne(targetEntity="PresentationSpeaker", inversedBy="moderated_presentations") @@ -169,10 +169,11 @@ class Presentation extends SummitEvent public function __construct() { parent::__construct(); - $this->materials = new ArrayCollection(); - $this->speakers = new ArrayCollection(); - $this->to_record = false; - $this->feature_cloud = false; + + $this->materials = new ArrayCollection(); + $this->speakers = new ArrayCollection(); + $this->to_record = false; + $this->attending_media = false; } /** @@ -475,19 +476,19 @@ class Presentation extends SummitEvent } /** - * @return mixed + * @return bool */ - public function getFeatureCloud() + public function getAttendingMedia() { - return $this->feature_cloud; + return $this->attending_media; } /** - * @param mixed $feature_cloud + * @param bool $attending_media */ - public function setFeatureCloud($feature_cloud) + public function setAttendingMedia($attending_media) { - $this->feature_cloud = $feature_cloud; + $this->attending_media = $attending_media; } /** diff --git a/app/Services/Model/SummitService.php b/app/Services/Model/SummitService.php index 4941b3b9..24a5b547 100644 --- a/app/Services/Model/SummitService.php +++ b/app/Services/Model/SummitService.php @@ -803,11 +803,12 @@ final class SummitService extends AbstractService implements ISummitService // main data if(isset($data['attendees_expected_learnt'])) $event->setAttendeesExpectedLearnt(html_entity_decode($data['attendees_expected_learnt'])); + if(isset($data['level'])) $event->setLevel($data['level']); - $event->setFeatureCloud(isset($data['feature_cloud'])? - filter_var($data['feature_cloud'], FILTER_VALIDATE_BOOLEAN) : 0); + $event->setAttendingMedia(isset($data['attending_media'])? + filter_var($data['attending_media'], FILTER_VALIDATE_BOOLEAN) : 0); // if we are creating the presentation from admin, then // we should mark it as received and complete