Summit Selection Plans Model Update
Added mapping for summit selection plans Change-Id: I134c8ceb5215b9f2461617d23c57636996d09fbb
This commit is contained in:
parent
9bf70c8192
commit
e06576303e
|
@ -24,12 +24,6 @@ final class SummitValidationRulesFactory
|
||||||
'name' => 'sometimes|string|max:50',
|
'name' => 'sometimes|string|max:50',
|
||||||
'start_date' => 'sometimes|date_format:U',
|
'start_date' => 'sometimes|date_format:U',
|
||||||
'end_date' => 'required_with:start_date|date_format:U|after_or_equal:start_date',
|
'end_date' => 'required_with:start_date|date_format:U|after_or_equal:start_date',
|
||||||
'submission_begin_date' => 'nullable|date_format:U',
|
|
||||||
'submission_end_date' => 'nullable|required_with:submission_begin_date|date_format:U|after_or_equal:submission_begin_date',
|
|
||||||
'voting_begin_date' => 'nullable|date_format:U',
|
|
||||||
'voting_end_date' => 'nullable|required_with:voting_begin_date|date_format:U|after_or_equal:voting_begin_date',
|
|
||||||
'selection_begin_date' => 'nullable|date_format:U',
|
|
||||||
'selection_end_date' => 'nullable|required_with:selection_begin_date|date_format:U|after_or_equal:selection_begin_date',
|
|
||||||
'registration_begin_date' => 'nullable|date_format:U',
|
'registration_begin_date' => 'nullable|date_format:U',
|
||||||
'registration_end_date' => 'nullable|required_with:registration_begin_date|date_format:U|after_or_equal:registration_begin_date',
|
'registration_end_date' => 'nullable|required_with:registration_begin_date|date_format:U|after_or_equal:registration_begin_date',
|
||||||
'start_showing_venues_date' => 'nullable|date_format:U|before_or_equal:start_date',
|
'start_showing_venues_date' => 'nullable|date_format:U|before_or_equal:start_date',
|
||||||
|
@ -53,12 +47,6 @@ final class SummitValidationRulesFactory
|
||||||
'name' => 'required|string|max:50',
|
'name' => 'required|string|max:50',
|
||||||
'start_date' => 'required|date_format:U',
|
'start_date' => 'required|date_format:U',
|
||||||
'end_date' => 'required_with:start_date|date_format:U|after_or_equal:start_date',
|
'end_date' => 'required_with:start_date|date_format:U|after_or_equal:start_date',
|
||||||
'submission_begin_date' => 'nullable|date_format:U',
|
|
||||||
'submission_end_date' => 'nullable|required_with:submission_begin_date|date_format:U|after_or_equal:submission_begin_date',
|
|
||||||
'voting_begin_date' => 'nullable|date_format:U',
|
|
||||||
'voting_end_date' => 'nullable|required_with:voting_begin_date|date_format:U|after_or_equal:voting_begin_date',
|
|
||||||
'selection_begin_date' => 'nullable|date_format:U',
|
|
||||||
'selection_end_date' => 'nullable|required_with:selection_begin_date|date_format:U|after_or_equal:selection_begin_date',
|
|
||||||
'registration_begin_date' => 'nullable|date_format:U',
|
'registration_begin_date' => 'nullable|date_format:U',
|
||||||
'registration_end_date' => 'nullable|required_with:registration_begin_date|date_format:U|after_or_equal:registration_begin_date',
|
'registration_end_date' => 'nullable|required_with:registration_begin_date|date_format:U|after_or_equal:registration_begin_date',
|
||||||
'start_showing_venues_date' => 'nullable|date_format:U|before_or_equal:start_date',
|
'start_showing_venues_date' => 'nullable|date_format:U|before_or_equal:start_date',
|
||||||
|
|
|
@ -45,6 +45,7 @@ use App\ModelSerializers\Summit\RSVP\Templates\RSVPQuestionValueTemplateSerializ
|
||||||
use App\ModelSerializers\Summit\RSVP\Templates\RSVPSingleValueTemplateQuestionSerializer;
|
use App\ModelSerializers\Summit\RSVP\Templates\RSVPSingleValueTemplateQuestionSerializer;
|
||||||
use App\ModelSerializers\Summit\RSVPTemplateSerializer;
|
use App\ModelSerializers\Summit\RSVPTemplateSerializer;
|
||||||
use App\ModelSerializers\Summit\ScheduledSummitLocationBannerSerializer;
|
use App\ModelSerializers\Summit\ScheduledSummitLocationBannerSerializer;
|
||||||
|
use App\ModelSerializers\Summit\SelectionPlanSerializer;
|
||||||
use App\ModelSerializers\Summit\SummitLocationBannerSerializer;
|
use App\ModelSerializers\Summit\SummitLocationBannerSerializer;
|
||||||
use Libs\ModelSerializers\IModelSerializer;
|
use Libs\ModelSerializers\IModelSerializer;
|
||||||
use ModelSerializers\ChatTeams\ChatTeamInvitationSerializer;
|
use ModelSerializers\ChatTeams\ChatTeamInvitationSerializer;
|
||||||
|
@ -96,6 +97,7 @@ final class SerializerRegistry
|
||||||
self::SerializerType_Private => AdminSummitSerializer::class
|
self::SerializerType_Private => AdminSummitSerializer::class
|
||||||
];
|
];
|
||||||
|
|
||||||
|
$this->registry['SelectionPlan'] = SelectionPlanSerializer::class;
|
||||||
$this->registry['SummitWIFIConnection'] = SummitWIFIConnectionSerializer::class;
|
$this->registry['SummitWIFIConnection'] = SummitWIFIConnectionSerializer::class;
|
||||||
$this->registry['SummitType'] = SummitTypeSerializer::class;
|
$this->registry['SummitType'] = SummitTypeSerializer::class;
|
||||||
$this->registry['SummitEventType'] = SummitEventTypeSerializer::class;
|
$this->registry['SummitEventType'] = SummitEventTypeSerializer::class;
|
||||||
|
|
|
@ -0,0 +1,72 @@
|
||||||
|
<?php namespace App\ModelSerializers\Summit;
|
||||||
|
/**
|
||||||
|
* Copyright 2018 OpenStack Foundation
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
**/
|
||||||
|
use App\Models\Foundation\Summit\SelectionPlan;
|
||||||
|
use ModelSerializers\SerializerRegistry;
|
||||||
|
use ModelSerializers\SilverStripeSerializer;
|
||||||
|
/**
|
||||||
|
* Class SelectionPlanSerializer
|
||||||
|
* @package App\ModelSerializers\Summit
|
||||||
|
*/
|
||||||
|
final class SelectionPlanSerializer extends SilverStripeSerializer
|
||||||
|
{
|
||||||
|
protected static $array_mappings = [
|
||||||
|
'Name' => 'name:json_string',
|
||||||
|
'Enabled' => 'is_enabled:json_boolean',
|
||||||
|
'SubmissionBeginDate' => 'submission_begin_date:datetime_epoch',
|
||||||
|
'SubmissionEndDate' => 'submission_end_date:datetime_epoch',
|
||||||
|
'VotingBeginDate' => 'voting_begin_date:datetime_epoch',
|
||||||
|
'VotingEndDate' => 'voting_end_date:datetime_epoch',
|
||||||
|
'SelectionBeginDate' => 'selection_begin_date:datetime_epoch',
|
||||||
|
'SelectionEndDate' => 'selection_end_date:datetime_epoch',
|
||||||
|
'SummitId' => 'summit_id:json_int',
|
||||||
|
];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param null $expand
|
||||||
|
* @param array $fields
|
||||||
|
* @param array $relations
|
||||||
|
* @param array $params
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function serialize($expand = null, array $fields = [], array $relations = [], array $params = [])
|
||||||
|
{
|
||||||
|
$selection_plan = $this->object;
|
||||||
|
if (!$selection_plan instanceof SelectionPlan) return [];
|
||||||
|
$values = parent::serialize($expand, $fields, $relations, $params);
|
||||||
|
|
||||||
|
$category_groups = [];
|
||||||
|
foreach ($selection_plan->getCategoryGroups() as $group) {
|
||||||
|
$category_groups[] = $group->getId();
|
||||||
|
}
|
||||||
|
$values['category_groups'] = $category_groups;
|
||||||
|
|
||||||
|
if (!empty($expand)) {
|
||||||
|
$expand = explode(',', $expand);
|
||||||
|
foreach ($expand as $relation) {
|
||||||
|
switch (trim($relation)) {
|
||||||
|
case 'category_groups':{
|
||||||
|
$category_groups = [];
|
||||||
|
foreach ($selection_plan->getCategoryGroups() as $group) {
|
||||||
|
$category_groups[] = SerializerRegistry::getInstance()->getSerializer($group)->serialize($expand);
|
||||||
|
}
|
||||||
|
$values['category_groups'] = $category_groups;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $values;
|
||||||
|
}
|
||||||
|
}
|
|
@ -26,12 +26,6 @@ class SummitSerializer extends SilverStripeSerializer
|
||||||
'Name' => 'name:json_string',
|
'Name' => 'name:json_string',
|
||||||
'BeginDate' => 'start_date:datetime_epoch',
|
'BeginDate' => 'start_date:datetime_epoch',
|
||||||
'EndDate' => 'end_date:datetime_epoch',
|
'EndDate' => 'end_date:datetime_epoch',
|
||||||
'SubmissionBeginDate' => 'submission_begin_date:datetime_epoch',
|
|
||||||
'SubmissionEndDate' => 'submission_end_date:datetime_epoch',
|
|
||||||
'VotingBeginDate' => 'voting_begin_date:datetime_epoch',
|
|
||||||
'VotingEndDate' => 'voting_end_date:datetime_epoch',
|
|
||||||
'SelectionBeginDate' => 'selection_begin_date:datetime_epoch',
|
|
||||||
'SelectionEndDate' => 'selection_end_date:datetime_epoch',
|
|
||||||
'RegistrationBeginDate' => 'registration_begin_date:datetime_epoch',
|
'RegistrationBeginDate' => 'registration_begin_date:datetime_epoch',
|
||||||
'RegistrationEndDate' => 'registration_end_date:datetime_epoch',
|
'RegistrationEndDate' => 'registration_end_date:datetime_epoch',
|
||||||
'StartShowingVenuesDate' => 'start_showing_venues_date:datetime_epoch',
|
'StartShowingVenuesDate' => 'start_showing_venues_date:datetime_epoch',
|
||||||
|
@ -62,6 +56,7 @@ class SummitSerializer extends SilverStripeSerializer
|
||||||
'ticket_types',
|
'ticket_types',
|
||||||
'locations',
|
'locations',
|
||||||
'wifi_connections',
|
'wifi_connections',
|
||||||
|
'selection_plans',
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -127,6 +122,15 @@ class SummitSerializer extends SilverStripeSerializer
|
||||||
$values['wifi_connections'] = $wifi_connections;
|
$values['wifi_connections'] = $wifi_connections;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// selection plans
|
||||||
|
if(in_array('selection_plans', $relations)) {
|
||||||
|
$selection_plans = [];
|
||||||
|
foreach ($summit->getSelectionPlans() as $selection_plan) {
|
||||||
|
$selection_plans[] = SerializerRegistry::getInstance()->getSerializer($selection_plan)->serialize($expand);
|
||||||
|
}
|
||||||
|
$values['selection_plans'] = $selection_plans;
|
||||||
|
}
|
||||||
|
|
||||||
if (!empty($expand)) {
|
if (!empty($expand)) {
|
||||||
$expand = explode(',', $expand);
|
$expand = explode(',', $expand);
|
||||||
foreach ($expand as $relation) {
|
foreach ($expand as $relation) {
|
||||||
|
|
|
@ -83,60 +83,6 @@ final class SummitFactory
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(array_key_exists('submission_begin_date', $data) && array_key_exists('submission_end_date', $data)) {
|
|
||||||
if (isset($data['submission_begin_date']) && isset($data['submission_end_date'])) {
|
|
||||||
$start_datetime = intval($data['submission_begin_date']);
|
|
||||||
$start_datetime = new \DateTime("@$start_datetime");
|
|
||||||
$start_datetime->setTimezone($summit->getTimeZone());
|
|
||||||
$end_datetime = intval($data['submission_end_date']);
|
|
||||||
$end_datetime = new \DateTime("@$end_datetime");
|
|
||||||
$end_datetime->setTimezone($summit->getTimeZone());
|
|
||||||
|
|
||||||
// set local time from UTC
|
|
||||||
$summit->setSubmissionBeginDate($start_datetime);
|
|
||||||
$summit->setSubmissionEndDate($end_datetime);
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
$summit->clearSubmissionDates();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(array_key_exists('voting_begin_date', $data) && array_key_exists('voting_end_date', $data)) {
|
|
||||||
if (isset($data['voting_begin_date']) && isset($data['voting_end_date'])) {
|
|
||||||
$start_datetime = intval($data['voting_begin_date']);
|
|
||||||
$start_datetime = new \DateTime("@$start_datetime");
|
|
||||||
$start_datetime->setTimezone($summit->getTimeZone());
|
|
||||||
$end_datetime = intval($data['voting_end_date']);
|
|
||||||
$end_datetime = new \DateTime("@$end_datetime");
|
|
||||||
$end_datetime->setTimezone($summit->getTimeZone());
|
|
||||||
|
|
||||||
// set local time from UTC
|
|
||||||
$summit->setVotingBeginDate($start_datetime);
|
|
||||||
$summit->setVotingEndDate($end_datetime);
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
$summit->clearVotingDates();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(array_key_exists('selection_begin_date', $data) && array_key_exists('selection_end_date', $data)) {
|
|
||||||
if (isset($data['selection_begin_date']) && isset($data['selection_end_date'])) {
|
|
||||||
$start_datetime = intval($data['selection_begin_date']);
|
|
||||||
$start_datetime = new \DateTime("@$start_datetime");
|
|
||||||
$start_datetime->setTimezone($summit->getTimeZone());
|
|
||||||
$end_datetime = intval($data['selection_end_date']);
|
|
||||||
$end_datetime = new \DateTime("@$end_datetime");
|
|
||||||
$end_datetime->setTimezone($summit->getTimeZone());
|
|
||||||
|
|
||||||
// set local time from UTC
|
|
||||||
$summit->setSelectionBeginDate($start_datetime);
|
|
||||||
$summit->setSelectionEndDate($end_datetime);
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
$summit->clearSelectionDates();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(array_key_exists('registration_begin_date', $data) && array_key_exists('registration_end_date', $data)) {
|
if(array_key_exists('registration_begin_date', $data) && array_key_exists('registration_end_date', $data)) {
|
||||||
if (isset($data['registration_begin_date']) && isset($data['registration_end_date'])) {
|
if (isset($data['registration_begin_date']) && isset($data['registration_end_date'])) {
|
||||||
$start_datetime = intval($data['registration_begin_date']);
|
$start_datetime = intval($data['registration_begin_date']);
|
||||||
|
|
|
@ -0,0 +1,259 @@
|
||||||
|
<?php namespace App\Models\Foundation\Summit;
|
||||||
|
/**
|
||||||
|
* Copyright 2018 OpenStack Foundation
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
**/
|
||||||
|
use App\Models\Utils\TimeZoneEntity;
|
||||||
|
use Doctrine\Common\Collections\ArrayCollection;
|
||||||
|
use models\summit\SummitOwned;
|
||||||
|
use models\utils\SilverstripeBaseModel;
|
||||||
|
use Doctrine\ORM\Mapping AS ORM;
|
||||||
|
use DateTime;
|
||||||
|
/**
|
||||||
|
* @ORM\Entity
|
||||||
|
* @ORM\Table(name="SelectionPlan")
|
||||||
|
* Class SelectionPlan
|
||||||
|
* @package App\Models\Foundation\Summit
|
||||||
|
*/
|
||||||
|
class SelectionPlan extends SilverstripeBaseModel
|
||||||
|
{
|
||||||
|
use SummitOwned;
|
||||||
|
|
||||||
|
use TimeZoneEntity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getTimeZoneId()
|
||||||
|
{
|
||||||
|
return $this->summit->getTimeZoneId();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ORM\Column(name="Name", type="string")
|
||||||
|
* @var String
|
||||||
|
*/
|
||||||
|
private $name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ORM\Column(name="Enabled", type="boolean")
|
||||||
|
* @var bool
|
||||||
|
*/
|
||||||
|
private $is_enabled;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ORM\Column(name="SubmissionBeginDate", type="datetime")
|
||||||
|
* @var \DateTime
|
||||||
|
*/
|
||||||
|
private $submission_begin_date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ORM\Column(name="SubmissionEndDate", type="datetime")
|
||||||
|
* @var \DateTime
|
||||||
|
*/
|
||||||
|
private $submission_end_date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ORM\Column(name="VotingBeginDate", type="datetime")
|
||||||
|
* @var \DateTime
|
||||||
|
*/
|
||||||
|
private $voting_begin_date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ORM\Column(name="VotingEndDate", type="datetime")
|
||||||
|
* @var \DateTime
|
||||||
|
*/
|
||||||
|
private $voting_end_date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ORM\Column(name="SelectionBeginDate", type="datetime")
|
||||||
|
* @var \DateTime
|
||||||
|
*/
|
||||||
|
private $selection_begin_date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ORM\Column(name="SelectionEndDate", type="datetime")
|
||||||
|
* @var \DateTime
|
||||||
|
*/
|
||||||
|
private $selection_end_date;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @ORM\ManyToMany(targetEntity="models\summit\PresentationCategoryGroup")
|
||||||
|
* @ORM\JoinTable(name="SelectionPlan_CategoryGroups",
|
||||||
|
* joinColumns={@JoinColumn(name="SelectionPlanID", referencedColumnName="ID")},
|
||||||
|
* inverseJoinColumns={@JoinColumn(name="PresentationCategoryGroupID", referencedColumnName="ID")}
|
||||||
|
* )
|
||||||
|
* @var PresentationCategoryGroup[]
|
||||||
|
*/
|
||||||
|
private $category_groups;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return DateTime
|
||||||
|
*/
|
||||||
|
public function getSubmissionBeginDate()
|
||||||
|
{
|
||||||
|
return $this->submission_begin_date;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param DateTime $submission_begin_date
|
||||||
|
*/
|
||||||
|
public function setSubmissionBeginDate(DateTime $submission_begin_date){
|
||||||
|
$this->submission_begin_date = $this->convertDateFromTimeZone2UTC($submission_begin_date);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return $this
|
||||||
|
*/
|
||||||
|
public function clearSubmissionDates(){
|
||||||
|
$this->submission_begin_date = $this->submission_end_date = null;
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return DateTime
|
||||||
|
*/
|
||||||
|
public function getSubmissionEndDate()
|
||||||
|
{
|
||||||
|
return $this->submission_end_date;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param DateTime $submission_end_date
|
||||||
|
*/
|
||||||
|
public function setSubmissionEndDate(DateTime $submission_end_date){
|
||||||
|
$this->submission_end_date = $this->convertDateFromTimeZone2UTC($submission_end_date);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return DateTime
|
||||||
|
*/
|
||||||
|
public function getVotingBeginDate()
|
||||||
|
{
|
||||||
|
return $this->voting_begin_date;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param DateTime $voting_begin_date
|
||||||
|
*/
|
||||||
|
public function setVotingBeginDate(DateTime $voting_begin_date){
|
||||||
|
$this->voting_begin_date = $this->convertDateFromTimeZone2UTC($voting_begin_date);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return $this
|
||||||
|
*/
|
||||||
|
public function clearVotingDates(){
|
||||||
|
$this->voting_begin_date = $this->voting_end_date = null;
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return DateTime
|
||||||
|
*/
|
||||||
|
public function getVotingEndDate()
|
||||||
|
{
|
||||||
|
return $this->voting_end_date;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param DateTime $voting_end_date
|
||||||
|
*/
|
||||||
|
public function setVotingEndDate(DateTime $voting_end_date){
|
||||||
|
$this->voting_end_date = $this->convertDateFromTimeZone2UTC($voting_end_date);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return DateTime
|
||||||
|
*/
|
||||||
|
public function getSelectionBeginDate()
|
||||||
|
{
|
||||||
|
return $this->selection_begin_date;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param DateTime $selection_begin_date
|
||||||
|
*/
|
||||||
|
public function setSelectionBeginDate(DateTime $selection_begin_date){
|
||||||
|
$this->selection_begin_date = $this->convertDateFromTimeZone2UTC($selection_begin_date);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return $this
|
||||||
|
*/
|
||||||
|
public function clearSelectionDates(){
|
||||||
|
$this->selection_begin_date = $this->selection_end_date = null;
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return DateTime
|
||||||
|
*/
|
||||||
|
public function getSelectionEndDate()
|
||||||
|
{
|
||||||
|
return $this->selection_end_date;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param DateTime $selection_end_date
|
||||||
|
*/
|
||||||
|
public function setSelectionEndDate(DateTime $selection_end_date){
|
||||||
|
$this->selection_end_date = $this->convertDateFromTimeZone2UTC($selection_end_date);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getName()
|
||||||
|
{
|
||||||
|
return $this->name;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param string $name
|
||||||
|
*/
|
||||||
|
public function setName($name)
|
||||||
|
{
|
||||||
|
$this->name = $name;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public function IsEnabled()
|
||||||
|
{
|
||||||
|
return $this->is_enabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param bool $is_enabled
|
||||||
|
*/
|
||||||
|
public function setIsEnabled($is_enabled)
|
||||||
|
{
|
||||||
|
$this->is_enabled = $is_enabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
parent::__construct();
|
||||||
|
$this->is_enabled = false;
|
||||||
|
$this->category_groups = new ArrayCollection;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return ArrayCollection
|
||||||
|
*/
|
||||||
|
public function getCategoryGroups()
|
||||||
|
{
|
||||||
|
return $this->category_groups;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -13,6 +13,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
**/
|
**/
|
||||||
use App\Models\Foundation\Summit\Events\RSVP\RSVPTemplate;
|
use App\Models\Foundation\Summit\Events\RSVP\RSVPTemplate;
|
||||||
|
use App\Models\Foundation\Summit\SelectionPlan;
|
||||||
use App\Models\Foundation\Summit\TrackTagGroup;
|
use App\Models\Foundation\Summit\TrackTagGroup;
|
||||||
use App\Models\Utils\TimeZoneEntity;
|
use App\Models\Utils\TimeZoneEntity;
|
||||||
use DateTime;
|
use DateTime;
|
||||||
|
@ -82,42 +83,6 @@ class Summit extends SilverstripeBaseModel
|
||||||
*/
|
*/
|
||||||
private $end_date;
|
private $end_date;
|
||||||
|
|
||||||
/**
|
|
||||||
* @ORM\Column(name="SubmissionBeginDate", type="datetime")
|
|
||||||
* @var \DateTime
|
|
||||||
*/
|
|
||||||
private $submission_begin_date;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ORM\Column(name="SubmissionEndDate", type="datetime")
|
|
||||||
* @var \DateTime
|
|
||||||
*/
|
|
||||||
private $submission_end_date;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ORM\Column(name="VotingBeginDate", type="datetime")
|
|
||||||
* @var \DateTime
|
|
||||||
*/
|
|
||||||
private $voting_begin_date;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ORM\Column(name="VotingEndDate", type="datetime")
|
|
||||||
* @var \DateTime
|
|
||||||
*/
|
|
||||||
private $voting_end_date;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ORM\Column(name="SelectionBeginDate", type="datetime")
|
|
||||||
* @var \DateTime
|
|
||||||
*/
|
|
||||||
private $selection_begin_date;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ORM\Column(name="SelectionEndDate", type="datetime")
|
|
||||||
* @var \DateTime
|
|
||||||
*/
|
|
||||||
private $selection_end_date;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ORM\Column(name="RegistrationBeginDate", type="datetime")
|
* @ORM\Column(name="RegistrationBeginDate", type="datetime")
|
||||||
* @var \DateTime
|
* @var \DateTime
|
||||||
|
@ -259,6 +224,12 @@ class Summit extends SilverstripeBaseModel
|
||||||
*/
|
*/
|
||||||
private $attendees;
|
private $attendees;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ORM\OneToMany(targetEntity="App\Models\Foundation\Summit\SelectionPlan", mappedBy="summit", cascade={"persist"}, orphanRemoval=true, fetch="EXTRA_LAZY")
|
||||||
|
* @var SelectionPlan[]
|
||||||
|
*/
|
||||||
|
private $selection_plans;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ORM\OneToMany(targetEntity="models\summit\PresentationCategoryGroup", mappedBy="summit", cascade={"persist"}, orphanRemoval=true, fetch="EXTRA_LAZY")
|
* @ORM\OneToMany(targetEntity="models\summit\PresentationCategoryGroup", mappedBy="summit", cascade={"persist"}, orphanRemoval=true, fetch="EXTRA_LAZY")
|
||||||
* @var PresentationCategoryGroup[]
|
* @var PresentationCategoryGroup[]
|
||||||
|
@ -573,6 +544,7 @@ class Summit extends SilverstripeBaseModel
|
||||||
$this->rsvp_templates = new ArrayCollection;
|
$this->rsvp_templates = new ArrayCollection;
|
||||||
$this->track_tag_groups = new ArrayCollection;
|
$this->track_tag_groups = new ArrayCollection;
|
||||||
$this->notifications = new ArrayCollection;
|
$this->notifications = new ArrayCollection;
|
||||||
|
$this->selection_plans = new ArrayCollection;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1394,158 +1366,6 @@ SQL;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return DateTime
|
|
||||||
*/
|
|
||||||
public function getSubmissionBeginDate()
|
|
||||||
{
|
|
||||||
return $this->submission_begin_date;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param DateTime $submission_begin_date
|
|
||||||
*/
|
|
||||||
public function setSubmissionBeginDate(DateTime $submission_begin_date){
|
|
||||||
$this->submission_begin_date = $this->convertDateFromTimeZone2UTC($submission_begin_date);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return $this
|
|
||||||
*/
|
|
||||||
public function clearSubmissionDates(){
|
|
||||||
$this->submission_begin_date = $this->submission_end_date = null;
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return DateTime
|
|
||||||
*/
|
|
||||||
public function getSubmissionEndDate()
|
|
||||||
{
|
|
||||||
return $this->submission_end_date;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param DateTime $submission_end_date
|
|
||||||
*/
|
|
||||||
public function setSubmissionEndDate(DateTime $submission_end_date){
|
|
||||||
$this->submission_end_date = $this->convertDateFromTimeZone2UTC($submission_end_date);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return DateTime
|
|
||||||
*/
|
|
||||||
public function getVotingBeginDate()
|
|
||||||
{
|
|
||||||
return $this->voting_begin_date;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param DateTime $voting_begin_date
|
|
||||||
*/
|
|
||||||
public function setVotingBeginDate(DateTime $voting_begin_date){
|
|
||||||
$this->voting_begin_date = $this->convertDateFromTimeZone2UTC($voting_begin_date);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return $this
|
|
||||||
*/
|
|
||||||
public function clearVotingDates(){
|
|
||||||
$this->voting_begin_date = $this->voting_end_date = null;
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return DateTime
|
|
||||||
*/
|
|
||||||
public function getVotingEndDate()
|
|
||||||
{
|
|
||||||
return $this->voting_end_date;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param DateTime $voting_end_date
|
|
||||||
*/
|
|
||||||
public function setVotingEndDate(DateTime $voting_end_date){
|
|
||||||
$this->voting_end_date = $this->convertDateFromTimeZone2UTC($voting_end_date);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return DateTime
|
|
||||||
*/
|
|
||||||
public function getSelectionBeginDate()
|
|
||||||
{
|
|
||||||
return $this->selection_begin_date;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param DateTime $selection_begin_date
|
|
||||||
*/
|
|
||||||
public function setSelectionBeginDate(DateTime $selection_begin_date){
|
|
||||||
$this->selection_begin_date = $this->convertDateFromTimeZone2UTC($selection_begin_date);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return $this
|
|
||||||
*/
|
|
||||||
public function clearSelectionDates(){
|
|
||||||
$this->selection_begin_date = $this->selection_end_date = null;
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return DateTime
|
|
||||||
*/
|
|
||||||
public function getSelectionEndDate()
|
|
||||||
{
|
|
||||||
return $this->selection_end_date;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param DateTime $selection_end_date
|
|
||||||
*/
|
|
||||||
public function setSelectionEndDate(DateTime $selection_end_date){
|
|
||||||
$this->selection_end_date = $this->convertDateFromTimeZone2UTC($selection_end_date);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return DateTime
|
|
||||||
*/
|
|
||||||
public function getRegistrationBeginDate()
|
|
||||||
{
|
|
||||||
return $this->registration_begin_date;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param DateTime $registration_begin_date
|
|
||||||
*/
|
|
||||||
public function setRegistrationBeginDate(DateTime $registration_begin_date){
|
|
||||||
$this->registration_begin_date = $this->convertDateFromTimeZone2UTC($registration_begin_date);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return $this
|
|
||||||
*/
|
|
||||||
public function clearRegistrationDates(){
|
|
||||||
$this->registration_begin_date = $this->registration_end_date = null;
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return DateTime
|
|
||||||
*/
|
|
||||||
public function getRegistrationEndDate()
|
|
||||||
{
|
|
||||||
return $this->registration_end_date;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param DateTime $registration_end_date
|
|
||||||
*/
|
|
||||||
public function setRegistrationEndDate(DateTime $registration_end_date){
|
|
||||||
$this->registration_end_date = $this->convertDateFromTimeZone2UTC($registration_end_date);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
|
@ -2097,4 +1917,51 @@ SQL;
|
||||||
{
|
{
|
||||||
return $this->calendar_sync_desc;
|
return $this->calendar_sync_desc;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
/**
|
||||||
|
* @return DateTime
|
||||||
|
*/
|
||||||
|
public function getRegistrationBeginDate()
|
||||||
|
{
|
||||||
|
return $this->registration_begin_date;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param DateTime $registration_begin_date
|
||||||
|
*/
|
||||||
|
public function setRegistrationBeginDate(DateTime $registration_begin_date){
|
||||||
|
$this->registration_begin_date = $this->convertDateFromTimeZone2UTC($registration_begin_date);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return $this
|
||||||
|
*/
|
||||||
|
public function clearRegistrationDates(){
|
||||||
|
$this->registration_begin_date = $this->registration_end_date = null;
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return DateTime
|
||||||
|
*/
|
||||||
|
public function getRegistrationEndDate()
|
||||||
|
{
|
||||||
|
return $this->registration_end_date;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param DateTime $registration_end_date
|
||||||
|
*/
|
||||||
|
public function setRegistrationEndDate(DateTime $registration_end_date){
|
||||||
|
$this->registration_end_date = $this->convertDateFromTimeZone2UTC($registration_end_date);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return SelectionPlan[]
|
||||||
|
*/
|
||||||
|
public function getSelectionPlans()
|
||||||
|
{
|
||||||
|
return $this->selection_plans;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
|
@ -43,7 +43,7 @@ trait TimeZoneEntity
|
||||||
public function getTimeZone()
|
public function getTimeZone()
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
return new DateTimeZone($this->time_zone_id);
|
return new DateTimeZone($this->getTimeZoneId());
|
||||||
} catch (\Exception $ex) {
|
} catch (\Exception $ex) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -74,7 +74,7 @@ final class OAuth2SummitApiTest extends ProtectedApiTest
|
||||||
$this->assertResponseStatus(200);
|
$this->assertResponseStatus(200);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testGetSummit($summit_id = 22)
|
public function testGetSummit($summit_id = 24)
|
||||||
{
|
{
|
||||||
|
|
||||||
$params = array
|
$params = array
|
||||||
|
|
Loading…
Reference in New Issue