Added missing serializer

Change-Id: Ia597d677e3ba9bbb4cbf237d0ea9cc1fa8501349
Signed-off-by: smarcet <smarcet@gmail.com>
This commit is contained in:
smarcet 2021-02-19 18:27:36 -03:00
parent dc6cfc296a
commit 83c9682b0a
3 changed files with 39 additions and 1 deletions

View File

@ -203,7 +203,7 @@ final class SerializerRegistry
$this->registry['SummitCategoryChange'] = SummitCategoryChangeSerializer::class;
// track chairs
$this->registry['PresentationTrackChairView'] = PresentationTrackChairViewSerializer::class;
$this->registry['SummitSelectedPresentationList'] = SummitSelectedPresentationListSerializer::class;
$this->registry['SummitSelectedPresentation'] = SummitSelectedPresentationSerializer::class;

View File

@ -0,0 +1,25 @@
<?php namespace ModelSerializers;
/**
* Copyright 2021 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.
**/
/**
* Class PresentationTrackChairViewSerializer
* @package ModelSerializers
*/
final class PresentationTrackChairViewSerializer extends SilverStripeSerializer
{
protected static $array_mappings = [
'ViewerId' => 'viewer_id:json_int',
'PresentationId' => 'presentation_id:json_int',
];
}

View File

@ -15,6 +15,7 @@ use Doctrine\ORM\Mapping AS ORM;
use models\main\Member;
use models\summit\Presentation;
use models\utils\SilverstripeBaseModel;
use models\utils\One2ManyPropertyTrait;
/**
* @ORM\Entity
* @ORM\Table(name="PresentationTrackChairView")
@ -23,6 +24,18 @@ use models\utils\SilverstripeBaseModel;
*/
class PresentationTrackChairView extends SilverstripeBaseModel
{
use One2ManyPropertyTrait;
protected $getIdMappings = [
'getViewerId' => 'viewer',
'getPresentationId' => 'presentation',
];
protected $hasPropertyMappings = [
'hasViewer' => 'viewer',
'hasPresentation' => 'presentation',
];
/**
* @ORM\ManyToOne(targetEntity="models\main\Member")
* @ORM\JoinColumn(name="TrackChairID", referencedColumnName="ID", onDelete="SET NULL")