Fix on post event

added boolean validation

Change-Id: I1d0fdfccee32d61db6cdabb00141ec6dba23fd0c
This commit is contained in:
Sebastian Marcet 2017-12-14 11:45:04 -03:00
parent b1c6270281
commit fd1c65ffc7
2 changed files with 14 additions and 8 deletions

View File

@ -162,9 +162,10 @@ class Presentation extends SummitEvent
public function __construct()
{
parent::__construct();
$this->materials = new ArrayCollection();
$this->speakers = new ArrayCollection();
$this->to_record = false;
$this->materials = new ArrayCollection();
$this->speakers = new ArrayCollection();
$this->to_record = false;
$this->feature_cloud = false;
}
/**

View File

@ -620,8 +620,8 @@ final class SummitService implements ISummitService
if (isset($data['title']))
$event->setTitle(html_entity_decode(trim($data['title'])));
if (isset($data['abstract']))
$event->setAbstract(html_entity_decode(trim($data['abstract'])));
if (isset($data['description']))
$event->setAbstract(html_entity_decode(trim($data['description'])));
if (isset($data['rsvp_link']))
$event->setRsvpLink(html_entity_decode(trim($data['rsvp_link'])));
@ -632,8 +632,9 @@ final class SummitService implements ISummitService
if (isset($data['social_summary']))
$event->setSocialSummary(strip_tags(trim($data['social_summary'])));
if (isset($data['allow_feedback']))
$event->setAllowFeedBack($data['allow_feedback']);
$event->setAllowFeedBack(isset($data['allow_feedback'])?
filter_var($data['allow_feedback'], FILTER_VALIDATE_BOOLEAN) :
false);
if (!is_null($event_type))
$event->setType($event_type);
@ -725,12 +726,16 @@ final class SummitService implements ISummitService
if(isset($data['level']))
$event->setLevel($data['level']);
$event->setFeatureCloud(isset($data['feature_cloud'])?
filter_var($data['feature_cloud'], FILTER_VALIDATE_BOOLEAN) : 0);
// if we are creating the presentation from admin, then
// we should mark it as received and complete
$event->setStatus(Presentation::STATUS_RECEIVED);
$event->setProgress(Presentation::PHASE_COMPLETE);
$event->setToRecord(isset($data['to_record'])? $data['to_record'] : 0);
$event->setToRecord(isset($data['to_record'])?
filter_var($data['to_record'], FILTER_VALIDATE_BOOLEAN): 0);
// speakers