openstackid-resources/app/Models/Foundation/Summit/Speakers/SpeakerTravelPreference.php
Sebastian Marcet 274dfad9b4 Added endpoint to send speaker announcement email
POST /api/v1/summits/{id}/speakers-assistances/{assistance_id}/mail

Change-Id: If503533f524f629d369209ae4832d80487af822d
2018-02-01 16:24:24 -03:00

79 lines
1.9 KiB
PHP

<?php namespace models\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 Doctrine\ORM\Mapping AS ORM;
use models\utils\SilverstripeBaseModel;
/**
* @ORM\Entity
* @ORM\Table(name="SpeakerTravelPreference")
* Class SpeakerTravelPreference
* @package models\summit
*/
class SpeakerTravelPreference extends SilverstripeBaseModel
{
/**
* @ORM\Column(name="Country", type="string")
*/
private $country;
/**
* @ORM\ManyToOne(targetEntity="PresentationSpeaker", inversedBy="travel_preferences")
* @ORM\JoinColumn(name="SpeakerID", referencedColumnName="ID")
* @var PresentationSpeaker
*/
private $speaker;
/**
* @return int
*/
public function getSpeakerId(){
try {
return !is_null($this->speaker) ? $this->speaker->getId() : 0;
}
catch(\Exception $ex){
return 0;
}
}
/**
* @return string
*/
public function getCountry()
{
return $this->country;
}
/**
* @param string $country
*/
public function setCountry($country)
{
$this->country = $country;
}
/**
* @return PresentationSpeaker
*/
public function getSpeaker()
{
return $this->speaker;
}
/**
* @param PresentationSpeaker $speaker
*/
public function setSpeaker($speaker)
{
$this->speaker = $speaker;
}
}