<?php
namespace App\Entity;
use App\Util\EsUtil;
use Firebase\JWT\JWT;
use App\Entity\VideoGallery;
use App\Annotation\EsUploadable;
use Doctrine\ORM\Mapping as ORM;
use App\Entity\Model\BulletPoint;
use App\Annotation\EsElasticIndex;
use App\Entity\SessionTranslation;
use App\Repository\SessionRepository;
use App\Entity\VideoGalleryTranslation;
use ApiPlatform\Core\Annotation\ApiFilter;
use App\Entity\Traits\TimestampableEntity;
use Doctrine\Common\Collections\Collection;
use ApiPlatform\Core\Annotation\ApiProperty;
use ApiPlatform\Core\Annotation\ApiResource;
use App\Validator\Constraints\IsDuplicateValue;
use App\Entity\Interfaces\UploadMappedInterface;
use Doctrine\Common\Collections\ArrayCollection;
use App\Entity\Interfaces\ElasticMappedInterface;
use App\Entity\Interfaces\SelfMetaMappedInterface;
use App\Entity\Interfaces\ContainerMappedInterface;
use App\Entity\Interfaces\NewsfeedCreatorInterface;
use Symfony\Component\Serializer\Annotation\Groups;
use Symfony\Component\Validator\Constraints as Assert;
use App\Entity\Interfaces\VideoGalleryCreatorInterface;
use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\DateFilter;
use Symfony\Component\Serializer\Annotation\SerializedName;
use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\OrderFilter;
use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\SearchFilter;
use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\BooleanFilter;
use Locastic\ApiPlatformTranslationBundle\Model\AbstractTranslatable;
use Locastic\ApiPlatformTranslationBundle\Model\TranslationInterface;
/**
* @ApiResource(
* attributes={"security"="is_granted('ROLE_OPERATOR')", "filters"={"translation.groups"}},
* normalizationContext={"groups"={"Session:Read"}, "skip_null_values"=false},
* denormalizationContext={"groups"={"Session:Write", "SessionTranslationsGroup"}},
* collectionOperations={
* "get"={
* "normalization_context"={"groups"={"Session:Read"}, "skip_null_values"=false},
* "security"="is_granted('ROLE_OPERATOR')"
* },
* "get_for_select"={
* "path"="/sessions/get-for-select",
* "method"="GET",
* "normalization_context"={"groups"={"Session:Select"}, "skip_null_values"=false},
* "security"="is_granted('IS_AUTHENTICATED_FULLY')"
* },
* "get_for_public_page"={
* "route_name"="api_pub_sessions_get_for_public_page_collection",
* "method"="GET",
* "security"="is_granted('PUBLIC_ACCESS')",
* "normalization_context"={"groups"={"Session:PRead"}, "skip_null_values"=false},
* "pagination_enabled"=true
* },
* "get_agenda"={
* "path"="/sessions/get-agenda",
* "method"="GET",
* "pagination_enabled"=false,
* "normalization_context"={"groups"={"Session:Read"}, "skip_null_values"=false},
* "security"="is_granted('IS_AUTHENTICATED_FULLY')"
* },
* "get_session"={
* "path"="/sessions/get-session",
* "method"="GET",
* "pagination_enabled"=false,
* "normalization_context"={"groups"={"Session:Read"}, "skip_null_values"=false},
* "security"="is_granted('IS_AUTHENTICATED_FULLY')"
* },
* "get_user_session"={
* "path"="/sessions/get-user-session",
* "method"="GET",
* "normalization_context"={"groups"={"Session:Read-Watched"}, "skip_null_values"=false},
* "security"="is_granted('IS_AUTHENTICATED_FULLY')"
* },
* "get_live_session"={
* "path"="/sessions/get-live-session",
* "method"="GET",
* "pagination_enabled"=false,
* "normalization_context"={"groups"={"Session:Read"}, "skip_null_values"=false},
* "security"="is_granted('IS_AUTHENTICATED_FULLY')"
* },
* "get_video_library"={
* "path"="/sessions/get-video-library",
* "method"="GET",
* "normalization_context"={"groups"={"Session:VideoLibrary"}, "skip_null_values"=false},
* "security"="is_granted('IS_AUTHENTICATED_FULLY')"
* },
* "get_for_video_gallery"={
* "path"="/sessions/get-for-video-gallery",
* "method"="GET",
* "normalization_context"={"groups"={"Session:VideoGallery"}, "skip_null_values"=false},
* "pagination_use_output_walkers"=true
* },
* "get_item"={
* "path"="/sessions/get-item",
* "method"="GET",
* "normalization_context"={"groups"={"Session:Read", "Session:GetItem"}, "skip_null_values"=false},
* "security"="is_granted('IS_AUTHENTICATED_FULLY')"
* },
* "get_item_detail"={
* "path"="/sessions/get-item-detail",
* "method"="GET",
* "normalization_context"={"groups"={"Session:GetItemDetail"}, "skip_null_values"=false},
* "security"="is_granted('IS_AUTHENTICATED_FULLY')"
* },
* "post",
* "post_change_card_size"={
* "route_name"="api_sessions_change_card_size_collection",
* "method"="POST",
* "denormalization_context"={"groups"={"Session:CardSize"}}
* },
* "post_sc_exist"={
* "route_name"="api_sessions_sc_exist_collection",
* "method"="POST",
* "denormalization_context"={"groups"={"Session:Sc-Exist"}, "skip_null_values"=false}
* }
* },
* itemOperations={
* "get"={
* "security"="is_granted('IS_CO_ANY', object)",
* "normalization_context"={"groups"={"Session:Read", "Session:GetItem"}, "skip_null_values"=false}
* },
* "get_last_session"={
* "route_name"="api_sessions_get_last_item",
* "method"="GET",
* "security"="is_granted('IS_CO_OPR', object)"
* },
* "put"={"security"="is_granted('IS_CO_OPR', object)"},
* "patch"={"security"="is_granted('IS_CO_OPR', object)"},
* "patch_set_delay"={
* "route_name"="api_sessions_set_delay_item",
* "method"="PATCH",
* "denormalization_context"={"groups"={"Session:SetDelay"}},
* "security"="is_granted('IS_CO_OPR', object)"
* },
* "patch_end_session"={
* "route_name"="api_sessions_end_session_item",
* "method"="PATCH",
* "denormalization_context"={"groups"={"Session:EndSession"}},
* "security"="is_granted('IS_CO_OPR', object)"
* },
* "patch_extend_session"={
* "path"="/sessions/{id}/extend-session",
* "method"="PATCH",
* "denormalization_context"={"groups"={"Session:ExtendSession"}},
* "security"="is_granted('IS_CO_OPR', object)"
* },
* "delete"={"security"="is_granted('IS_CO_OPR', object)"}
* }
* )
* @ApiFilter(SearchFilter::class, properties={"id": "exact", "container.id": "exact", "conference.id": "exact", "sessionTags.id": "exact", "translations.title": "partial", "sessionCategory.id": "exact", "speakers.id": "exact", "moderators.id": "exact", "speakers.roles": "exact", "moderators.roles": "exact", "streamType": "exact", "watchTimes.user.id": "exact"})
* @ApiFilter(BooleanFilter::class, properties={"isVisible", "isShowInVideoLibrary", "isLive", "isReply", "isAskSpeakerEnable", "isLastOfTheDay"})
* @ApiFilter(DateFilter::class, properties={"start", "end"})
* @ApiFilter(OrderFilter::class, properties={"translations.title": "ASC", "start", "watchTimes.start", "conference.translations.title"})
* @ORM\Entity(repositoryClass=SessionRepository::class)
* @ORM\Table(
* indexes={
* @ORM\Index(name="session_ord_idx", columns={"ord"}),
* @ORM\Index(name="session_start_idx", columns={"start"}),
* @ORM\Index(name="session_end_idx", columns={"end"})
* }
* )
* @EsElasticIndex("Session:EL")
*/
class Session extends AbstractTranslatable implements ContainerMappedInterface, UploadMappedInterface, NewsfeedCreatorInterface, SelfMetaMappedInterface, VideoGalleryCreatorInterface, ElasticMappedInterface
{
/**
* Hook timestampable behavior
* updates createdAt, updatedAt fields
*/
use TimestampableEntity;
/**
* @ORM\OneToMany(targetEntity="SessionTranslation", mappedBy="translatable", fetch="EXTRA_LAZY", indexBy="locale", cascade={"PERSIST"}, orphanRemoval=true)
*
* @Groups({"Session:EL", "Session:Write", "SessionTranslationsGroup"})
* @Assert\Valid()
*/
protected $translations;
/**
* @Groups({"Session:Read", "Session:GetItemDetail", "Session:PRead", "Session:Agenda", "Session:Read-Watched", "Session:Select", "Session:VideoGallery", "Session:VideoLibrary", "WatchTime:Read", "VoteQuestion:Read", "SessionComment:Read", "SessionQuestion:Read", "SessionQuestion:Exp", "VoteResult:Exp", "ElTask:Read", "ElExam:Read"})
*/
private $title;
/**
* @Groups({"Session:Read", "Session:GetItemDetail", "Session:PRead", "Session:Agenda", "Session:VideoLibrary", "Session:Select", "ElTask:Read"})
*/
private $description;
/**
* @Groups({"Session:Read", "Session:GetItemDetail", "Session:PRead", "Session:Agenda", "Session:VideoLibrary", "Session:Select", "ElTask:Read", "ElExam:Read-Solution"})
*/
private $streamUrl;
/**
* @Groups({"Session:Read", "Session:GetItemDetail", "Session:PRead", "Session:Agenda", "Session:VideoLibrary", "Session:Select", "ElTask:Read", "ElExam:Read-Solution"})
*/
private $onsiteMessage;
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
* @Groups({"Session:EL", "Session:Read", "Session:GetItemDetail", "Session:PRead", "Session:Agenda", "Session:Read-Watched", "Session:Select", "Session:VideoGallery", "Session:VideoLibrary", "WatchTime:Read", "VoteQuestion:Read", "ElTask:Read", "ElExam:Read"})
*/
private $id;
/**
* @ORM\Column(type="boolean", nullable=true)
* @Groups({"Session:Read", "Session:GetItemDetail", "Session:Write", "Session:VideoLibrary"})
*
* @Assert\Type(type="bool", message="validation.session:isVisible.typeBool")
*/
private $isVisible;
/**
* @ORM\Column(type="datetime")
* @Groups({"Session:EL", "Session:Read", "Session:GetItemDetail", "Session:PRead", "Session:Agenda", "Session:Read-Watched", "Session:Select", "Session:Write", "Session:VideoGallery", "Session:VideoLibrary", "ElTask:Read"})
*
* @Assert\NotBlank(message="validation.session:start.notBlank")
*/
private $start;
/**
* @ORM\Column(type="datetime")
* @Groups({"Session:EL", "Session:Read", "Session:GetItemDetail", "Session:PRead", "Session:Agenda", "Session:Read-Watched", "Session:Select", "Session:Write", "Session:VideoGallery", "Session:VideoLibrary", "ElTask:Read"})
*
* @Assert\NotBlank(message="validation.session:end.notBlank")
*/
private $end;
/**
* @ORM\ManyToOne(targetEntity=Container::class)
* @ORM\JoinColumn(nullable=false, onDelete="CASCADE")
*
* @Groups({"Session:Read", "Session:GetItemDetail", "Session:PRead", "Session:Write", "Session:PRead"})
*/
private $container;
/**
* @ORM\Column(type="string", length=255, nullable=true)
* @Groups({"Session:EL", "Session:Read", "Session:GetItemDetail", "Session:PRead", "Session:Agenda", "Session:Read-Watched", "Session:Select", "Session:Write", "Session:VideoGallery", "Session:VideoLibrary", "ElTask:Read", "ElExam:Read"})
*
* @Assert\Length(max=255, maxMessage="validation.session:imageName.max")
* @EsUploadable()
*/
protected $imageName;
/**
* @ORM\ManyToOne(targetEntity=Conference::class, inversedBy="sessions")
* @ORM\JoinColumn(nullable=false, onDelete="CASCADE")
*
* @Groups({"Session:Read", "Session:GetItemDetail", "Session:PRead", "Session:Read-Watched", "Session:Write", "Session:VideoGallery", "Session:VideoLibrary", "VoteQuestion:Read", "SessionQuestion:Read", "ElTask:Read", "ElExam:Read"})
*/
private $conference;
/**
* @ORM\OneToMany(targetEntity=SessionComment::class, mappedBy="session", orphanRemoval=true)
*/
private $sessionComments;
/**
* @ORM\ManyToMany(targetEntity=SessionTag::class, inversedBy="sessions", cascade={"persist"})
*
* @Groups({"Session:Read", "Session:GetItemDetail", "Session:Write", "Session:VideoLibrary"})
*/
private $sessionTags;
/**
* @ORM\OneToMany(targetEntity=SessionDoc::class, mappedBy="session", orphanRemoval=true, cascade={"persist"})
*
* @Groups({"Session:Read", "Session:Write"})
*/
private $sessionDocs;
/**
* @ORM\ManyToOne(targetEntity=CommonCategory::class)
* @ORM\JoinColumn(nullable=true, onDelete="SET NULL")
*
* @Groups({"Session:Read", "Session:GetItemDetail", "Session:PRead", "Session:Read-Watched", "Session:Agenda", "Session:Write"})
*/
private $sessionCategory;
/**
* @ORM\Column(type="boolean", nullable=true)
* @Groups({"Session:Read", "Session:GetItemDetail", "Session:Write"})
*
* @Assert\Type(type="bool", message="validation.session:isCommentEnable.typeBool")
*/
private $isCommentEnable;
/**
* @ORM\Column(type="boolean", nullable=true)
* @Groups({"Session:Read", "Session:GetItemDetail", "Session:Write"})
*
* @Assert\Type(type="bool", message="validation.session:isCommentModerated.typeBool")
*/
private $isCommentModerated;
/**
* @ORM\Column(type="boolean", nullable=true)
* @Groups({"Session:Read", "Session:GetItemDetail", "Session:Write"})
*
* @Assert\Type(type="bool", message="validation.session:isSharingEnable.typeBool")
*/
private $isSharingEnable;
/**
* @ORM\Column(type="boolean", nullable=true)
* @Groups({"Session:Read", "Session:GetItemDetail", "Session:Write"})
*
* @Assert\Type(type="bool", message="validation.session:isLikeEnable.typeBool")
*/
private $isLikeEnable;
/**
* @ORM\Column(type="boolean", nullable=true)
* @Groups({"Session:Read", "Session:GetItemDetail", "Session:Write"})
*
* @Assert\Type(type="bool", message="validation.session:isJoinRequired.typeBool")
*/
private $isJoinRequired;
/**
* @ORM\Column(type="boolean", nullable=true)
* @Groups({"Session:Read", "Session:GetItemDetail", "Session:Write"})
*
* @Assert\Type(type="bool", message="validation.session:isSessionPublic.typeBool")
*/
private $isSessionPublic;
/**
* @ORM\Column(type="boolean", nullable=true)
* @Groups({"Session:Read", "Session:GetItemDetail", "Session:Write"})
*
* @Assert\Type(type="bool", message="validation.session:isExternalLinkEnable.typeBool")
*/
private $isExternalLinkEnable;
/**
* @ORM\Column(type="string", length=255, nullable=true)
* @Groups({"Session:Read", "Session:GetItemDetail", "Session:Write"})
*
* @Assert\Length(max=255, maxMessage="validation.session:externalLinkLabel.max")
*/
private $externalLinkLabel;
/**
* @ORM\Column(type="string", length=255, nullable=true)
* @Groups({"Session:Read", "Session:GetItemDetail", "Session:Write"})
*
* @Assert\Length(max=255, maxMessage="validation.session:externalLinkUrl.max")
*/
private $externalLinkUrl;
/**
* @ORM\Column(type="boolean", nullable=true)
* @Groups({"Session:Read", "Session:Write"})
*
* @Assert\Type(type="bool", message="validation.session:isVisible.typeBool")
*/
private $isShowInVideoLibrary;
/**
* @ORM\Column(type="boolean", nullable=true)
* @Groups({"Session:Read", "Session:GetItemDetail", "Session:Write"})
*
* @Assert\Type(type="bool", message="validation.session:isVisible.typeBool")
*/
private $isSessionAutoSwitch;
/**
* @ORM\ManyToMany(targetEntity=User::class)
* @ORM\JoinTable(name="rel_session_speaker")
* @Groups({"Session:EL", "Session:Read", "Session:GetItemDetail", "Session:PRead", "Session:Agenda", "Session:Write", "Session:VideoLibrary", "SessionQuestion:Read", "Session:Select"})
* @ORM\OrderBy({"lastName" = "ASC"})
*/
private $speakers;
/**
* @ORM\ManyToMany(targetEntity=User::class)
* @ORM\JoinTable(name="rel_session_moderator")
* @Groups({"Session:EL", "Session:Read", "Session:GetItemDetail", "Session:PRead", "Session:Agenda", "Session:Write", "SessionQuestion:Read"})
* @ORM\OrderBy({"lastName" = "ASC"})
*/
private $moderators;
/**
* @ORM\Column(type="string", length=32, nullable=true)
* @Groups({"Session:Read", "Session:GetItemDetail", "Session:PRead", "Session:Agenda", "Session:Write", "Session:VideoLibrary", "ElTask:Read", "ElExam:Read-Solution"})
*/
private $streamType;
public const STREAMTYPE_YOUTUBE = "YOUTUBE";
public const STREAMTYPE_VIMEO = "VIMEO";
public const STREAMTYPE_SWISSCOM = "SWISSCOM";
public const STREAMTYPE_DACAST = "DACAST";
public const STREAMTYPE_KNOVIO = "KNOVIO";
public const STREAMTYPE_ZOOM = "ZOOM";
public const STREAMTYPE_WEBEX = "WEBEX";
public const STREAMTYPE_FILE = "FILE";
public const STREAMTYPE_EXPERTSHARE = "EXPERTSHARE";
public const STREAMTYPE_QUMU = "QUMU";
/**
* @ORM\Column(type="string", length=255, nullable=true)
* @Groups({"Session:Read", "Session:GetItemDetail", "Session:Agenda", "Session:Write", "Session:VideoLibrary", "ElTask:Read"})
*
* @Assert\Length(max=255, maxMessage="validation.session:zoomUrl.max")
*/
private $zoomUrl;
/**
* @ORM\Column(type="string", length=255, nullable=true)
* @Groups({"Session:Read", "Session:GetItemDetail", "Session:Agenda", "Session:Write", "Session:VideoLibrary", "ElTask:Read"})
*
* @Assert\Length(max=255, maxMessage="validation.session:zoomMeetingNumber.max")
*/
private $zoomMeetingNumber;
/**
* @ORM\Column(type="string", length=255, nullable=true)
* @Groups({"Session:Read", "Session:GetItemDetail", "Session:Agenda", "Session:Write", "Session:VideoLibrary", "ElTask:Read"})
*
* @Assert\Length(max=255, maxMessage="validation.session:zoomMeetingPassword.max")
*/
private $zoomMeetingPassword;
/**
* @ORM\Column(type="string", length=255, nullable=true)
* @Groups({"Session:Read", "Session:GetItemDetail", "Session:Agenda", "Session:Write", "Session:VideoLibrary", "ElTask:Read"})
*
* @Assert\Length(max=255, maxMessage="validation.session:webexUrl.max")
*/
private $webexUrl;
/**
* @ORM\Column(type="string", length=255, nullable=true)
* @Groups({"Session:Read", "Session:GetItemDetail", "Session:Agenda", "Session:Write", "Session:VideoLibrary", "ElTask:Read"})
*
* @Assert\Length(max=255, maxMessage="validation.session:webexMeetingPassword.max")
*/
private $webexMeetingPassword;
/**
* @ORM\Column(type="string", length=32, nullable=true)
* @ApiProperty(
* attributes={
* "openapi_context"={
* "type"="string",
* "enum"={self::CARDSIZE_SMALL, self::CARDSIZE_MEDIUM, self::CARDSIZE_LARGE, self::CARDSIZE_XLARGE, self::CARDSIZE_COMPACT}
* }
* }
* )
* @Groups({"Session:Read", "Session:GetItemDetail", "Session:Agenda", "Session:Write", "Session:CardSize", "Session:PRead"})
*
* @Assert\Choice({self::CARDSIZE_SMALL, self::CARDSIZE_MEDIUM, self::CARDSIZE_LARGE, self::CARDSIZE_XLARGE, self::CARDSIZE_COMPACT})
*/
private $cardSize;
public const CARDSIZE_SMALL = "SMALL";
public const CARDSIZE_MEDIUM = "MEDIUM";
public const CARDSIZE_LARGE = "LARGE";
public const CARDSIZE_XLARGE = "XLARGE";
public const CARDSIZE_COMPACT = "COMPACT";
/**
* @ORM\Column(type="string", length=32, nullable=true)
* @ApiProperty(
* attributes={
* "openapi_context"={
* "type"="string",
* "enum"={self::CARDTYPE_COMPACT, self::CARDTYPE_DETAIL}
* }
* }
* )
* @Groups({"Session:Read", "Session:GetItemDetail", "Session:Agenda", "Session:Write", "Session:PRead"})
*
* @Assert\Choice({self::CARDTYPE_COMPACT, self::CARDTYPE_DETAIL})
*/
private $cardType;
public const CARDTYPE_COMPACT = "COMPACT";
public const CARDTYPE_DETAIL = "DETAIL";
/**
* @ORM\Column(type="integer", nullable=true)
* @Groups({"Session:Read", "Session:GetItemDetail", "Session:PRead", "Session:Agenda", "Session:Write", "Session:VideoLibrary"})
*
* @Assert\Type(type="integer", message="validation.session:ord.typeInteger")
*/
private $ord;
/**
* @Groups({"Session:CardSize"})
*/
private array $ids;
/**
* @ORM\ManyToMany(targetEntity=UserGroup::class, inversedBy="sessions")
* @Groups({"Session:Read", "Session:GetItemDetail", "Session:Write"})
*/
private $userGroups;
/**
* @ORM\Column(type="boolean", nullable=true)
* @Groups({"Session:Read", "Session:GetItemDetail", "Session:Agenda", "Session:Write"})
*/
private $isReply;
/**
* @ORM\Column(type="boolean", nullable=true)
* @Groups({"Session:Read", "Session:GetItemDetail", "Session:PRead", "Session:Agenda", "Session:Write", "ElTask:Read"})
*/
private $isLive;
/**
* @ORM\OneToMany(targetEntity=SessionQuestion::class, mappedBy="session", orphanRemoval=true)
*/
private $sessionQuestions;
/**
* @ORM\Column(type="boolean", nullable=true)
* @Groups({"Session:Read", "Session:GetItemDetail", "Session:Write"})
*/
private $isQuestionEnable;
/**
* @ORM\Column(type="boolean", nullable=true)
* @Groups({"Session:Read", "Session:GetItemDetail", "Session:Write"})
*/
private $isAnswerEnable;
/**
* @ORM\Column(type="boolean", nullable=true)
* @Groups({"Session:Read", "Session:GetItemDetail", "Session:Write"})
*/
private $isQuestionModerated;
/**
* @ORM\Column(type="boolean", nullable=true)
* @Groups({"Session:Read", "Session:GetItemDetail", "Session:Write"})
*
* @Assert\Type(type="bool", message="validation.session:isAskSpeakerEnable.typeBool")
*/
private $isAskSpeakerEnable;
/**
* @ORM\Column(type="boolean", nullable=true)
* @Groups({"Session:Read", "Session:GetItemDetail", "Session:Write"})
*
* @Assert\Type(type="bool", message="validation.session:isAskSpeakerPublicEnable.typeBool")
*/
private $isAskSpeakerPublicEnable;
/**
* @ORM\OneToMany(targetEntity=WatchTime::class, mappedBy="session", orphanRemoval=true)
*/
private $watchTimes;
/**
* @ORM\Column(type="boolean", nullable=true)
* @Groups({"Session:Read", "Session:GetItemDetail", "Session:Write"})
*/
private $isSendReminder;
/**
* @ORM\OneToMany(targetEntity=CommonComment::class, mappedBy="session")
*/
private $commonComments;
/**
* @ORM\Column(type="json", nullable=true)
* @Groups({"Session:Read", "Session:Read-Watched", "Session:Read-Public"})
*/
private $meta = [];
/**
* @ORM\Column(type="boolean", nullable=true)
* @Groups({"Session:Read", "Session:GetItemDetail", "Session:Write"})
*/
private $isShowPublic;
/**
* @ORM\Column(type="integer", nullable=true)
* @Groups({"Session:Read", "Session:GetItemDetail", "Session:Read-Watched", "Session:Read-Public"})
*/
private $totalReactions;
/**
* @ORM\Column(type="array", nullable=true)
* @Groups({"Session:Read", "Session:GetItemDetail", "Session:Read-Watched", "Session:Read-Public"})
*/
private $totalReactionsByType = [];
/**
* @ORM\Column(type="boolean", nullable=true)
* @Groups({"Session:Read", "Session:GetItemDetail", "Session:Write", "Session:Read-Watched", "Session:Read-Public"})
*/
private $isSessionReactionEnable;
/**
* @Groups({"Session:SetDelay"})
*/
private int $delay = 0;
/**
* @ORM\OneToMany(targetEntity=SessionChapter::class, mappedBy="session", orphanRemoval=true)
* @Groups({"Session:GetItem"})
*/
private $sessionChapters;
/**
* @ORM\Column(type="array", nullable=true)
* @Groups({"Session:EL", "Session:Read", "Session:Write", "Session:GetItemDetail", "Session:PRead", "Session:Agenda", "Session:VideoLibrary", "Session:Select", "ElTask:Read"})
*/
private $bulletPoints = [];
/**
* @ORM\ManyToOne(targetEntity=VideoGallery::class)
* @ORM\JoinColumn(nullable=true, onDelete="SET NULL")
* @Groups({"Session:GetItem"})
*/
private $videoGallery;
/**
* @ORM\Column(type="boolean", nullable=true)
* @Groups({"Session:Read", "Session:Write"})
*/
private $isNotConsiderForCertificate;
/**
* @ORM\OneToMany(targetEntity=VoteQuestion::class, mappedBy="session")
* @Groups({"Session:GetItemDetail"})
*/
private $voteQuestions;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private $oldId;
/**
* @ORM\Column(type="string", length=32, nullable=true)
* @Groups({"Session:Read", "Session:Write", "Session:GetItemDetail", "Session:Select", "VoteQuestion:Read", "Session:Sc-Exist"})
* @IsDuplicateValue(field="shortCode", entityName=self::class)
*/
private $shortCode;
/**
* @Groups({"Session:Sc-Exist"})
*/
private $currentId;
/**
* @Groups({"Session:Read", "Session:GetItemDetail", "Session:Write"})
*/
private $nextSession;
/**
* @ORM\Column(type="datetime", nullable=true)
* @Groups({"Session:Read", "Session:ExtendSession"})
*/
private $lastExtendAt;
/**
* @ORM\Column(type="boolean", nullable=true)
* @Groups({"Session:Read", "Session:GetItemDetail", "Session:Write"})
*/
private $isLastOfTheDay;
/**
* @ORM\Column(type="boolean", nullable=true)
* @Groups({"Session:Read", "Session:GetItemDetail", "Session:Write"})
*/
private $isOnsite;
public function __construct()
{
parent::__construct();
$this->sessionComments = new ArrayCollection();
$this->sessionTags = new ArrayCollection();
$this->sessionDocs = new ArrayCollection();
$this->speakers = new ArrayCollection();
$this->moderators = new ArrayCollection();
$this->userGroups = new ArrayCollection();
$this->sessionQuestions = new ArrayCollection();
$this->watchTimes = new ArrayCollection();
$this->commonComments = new ArrayCollection();
$this->sessionChapters = new ArrayCollection();
$this->voteQuestions = new ArrayCollection();
$bulletPointModel = new BulletPoint();
$this->bulletPoints = $bulletPointModel->getProperties();
}
protected function createTranslation(): TranslationInterface
{
return new SessionTranslation();
}
public function addTranslation(TranslationInterface $translation): void
{
$this->setUpdatedAt(new \DateTime());
parent::addTranslation($translation);
}
public function getTitle(): ?string
{
return $this->getTranslation()->getTitle();
}
public function setTitle(string $title): self
{
$this->getTranslation()->setTitle($title);
return $this;
}
public function getDescription(): ?string
{
return $this->getTranslation()->getDescription();
}
public function setDescription(string $description): self
{
$this->getTranslation()->setDescription($description);
return $this;
}
public function getStreamUrl(): ?string
{
return $this->getTranslation()->getStreamUrl();
}
public function setStreamUrl(string $streamUrl): self
{
$this->getTranslation()->setStreamUrl($streamUrl);
return $this;
}
public function getOnsiteMessage(): ?string
{
return $this->getTranslation()->getOnsiteMessage();
}
public function setOnsiteMessage(string $onsiteMessage): self
{
$this->getTranslation()->setOnsiteMessage($onsiteMessage);
return $this;
}
public function getId(): ?int
{
return $this->id;
}
public function getIsVisible(): ?bool
{
return $this->isVisible;
}
public function setIsVisible(?bool $isVisible): self
{
$this->isVisible = $isVisible;
return $this;
}
public function getStart(): ?\DateTimeInterface
{
return $this->start;
}
public function setStart(\DateTimeInterface $start): self
{
$this->start = $start;
return $this;
}
public function getEnd(): ?\DateTimeInterface
{
return $this->end;
}
public function setEnd(\DateTimeInterface $end): self
{
$this->end = $end;
return $this;
}
public function getContainer(): ?Container
{
return $this->container;
}
public function setContainer(?Container $container): self
{
$this->container = $container;
return $this;
}
public function getImageName(): ?string
{
return $this->imageName;
}
public function setImageName(?string $imageName): self
{
$this->imageName = $imageName;
return $this;
}
public function getConference(): ?Conference
{
return $this->conference;
}
public function setConference(?Conference $conference): self
{
$this->conference = $conference;
return $this;
}
/**
* @return Collection|SessionComment[]
*/
public function getSessionComments(): Collection
{
return $this->sessionComments;
}
public function addSessionComment(SessionComment $sessionComment): self
{
if (!$this->sessionComments->contains($sessionComment)) {
$this->sessionComments[] = $sessionComment;
$sessionComment->setSession($this);
}
return $this;
}
public function removeSessionComment(SessionComment $sessionComment): self
{
if ($this->sessionComments->removeElement($sessionComment)) {
// set the owning side to null (unless already changed)
if ($sessionComment->getSession() === $this) {
$sessionComment->setSession(null);
}
}
return $this;
}
/**
* @return Collection|SessionTag[]
*/
public function getSessionTags(): Collection
{
return $this->sessionTags;
}
/**
* @Groups({"Session:EL"})
* @SerializedName("tags")
*/
public function getTagsArray()
{
$tags = [];
foreach ($this->sessionTags as $tag) {
$tags[] = $tag->getName();
}
return $tags;
}
public function addSessionTag(SessionTag $sessionTag): self
{
if (!$this->sessionTags->contains($sessionTag)) {
$this->sessionTags[] = $sessionTag;
}
return $this;
}
public function removeSessionTag(SessionTag $sessionTag): self
{
$this->sessionTags->removeElement($sessionTag);
return $this;
}
public function removeAllSessionTags(): self
{
foreach ($this->sessionTags as $tag) {
$this->removeSessionTag($tag);
}
return $this;
}
public function reAttachTags(): self
{
$tags = $this->sessionTags;
foreach ($tags as $tag) {
$nt = clone $tag;
$nt->setContainer($this->getContainer());
$this->removeSessionTag($tag);
$this->addSessionTag($nt);
}
return $this;
}
/**
* @return Collection|SessionDoc[]
*/
public function getSessionDocs(): Collection
{
return $this->sessionDocs;
}
public function addSessionDoc(SessionDoc $sessionDoc): self
{
if (!$this->sessionDocs->contains($sessionDoc)) {
$this->sessionDocs[] = $sessionDoc;
$sessionDoc->setSession($this);
}
return $this;
}
public function removeSessionDoc(SessionDoc $sessionDoc): self
{
if ($this->sessionDocs->removeElement($sessionDoc)) {
// set the owning side to null (unless already changed)
if ($sessionDoc->getSession() === $this) {
$sessionDoc->setSession(null);
}
}
return $this;
}
public function getSessionCategory(): ?CommonCategory
{
return $this->sessionCategory;
}
public function setSessionCategory(?CommonCategory $sessionCategory): self
{
$this->sessionCategory = $sessionCategory;
return $this;
}
public function getIsCommentEnable(): ?bool
{
return $this->isCommentEnable;
}
public function setIsCommentEnable(?bool $isCommentEnable): self
{
$this->isCommentEnable = $isCommentEnable;
return $this;
}
public function getIsCommentModerated(): ?bool
{
return $this->isCommentModerated;
}
public function setIsCommentModerated(?bool $isCommentModerated): self
{
$this->isCommentModerated = $isCommentModerated;
return $this;
}
public function getIsSharingEnable(): ?bool
{
return $this->isSharingEnable;
}
public function setIsSharingEnable(?bool $isSharingEnable): self
{
$this->isSharingEnable = $isSharingEnable;
return $this;
}
public function getIsLikeEnable(): ?bool
{
return $this->isLikeEnable;
}
public function setIsLikeEnable(?bool $isLikeEnable): self
{
$this->isLikeEnable = $isLikeEnable;
return $this;
}
public function getIsJoinRequired(): ?bool
{
return $this->isJoinRequired;
}
public function setIsJoinRequired(?bool $isJoinRequired): self
{
$this->isJoinRequired = $isJoinRequired;
return $this;
}
public function getIsSessionPublic(): ?bool
{
return $this->isSessionPublic;
}
public function setIsSessionPublic(?bool $isSessionPublic): self
{
$this->isSessionPublic = $isSessionPublic;
return $this;
}
public function getIsExternalLinkEnable(): ?bool
{
return $this->isExternalLinkEnable;
}
public function setIsExternalLinkEnable(?bool $isExternalLinkEnable): self
{
$this->isExternalLinkEnable = $isExternalLinkEnable;
return $this;
}
public function getExternalLinkLabel(): ?string
{
return $this->externalLinkLabel;
}
public function setExternalLinkLabel(?string $externalLinkLabel): self
{
$this->externalLinkLabel = $externalLinkLabel;
return $this;
}
public function getExternalLinkUrl(): ?string
{
return $this->externalLinkUrl;
}
public function setExternalLinkUrl(?string $externalLinkUrl): self
{
$this->externalLinkUrl = $externalLinkUrl;
return $this;
}
public function getIsShowInVideoLibrary(): ?bool
{
return $this->isShowInVideoLibrary;
}
public function setIsShowInVideoLibrary(?bool $isShowInVideoLibrary): self
{
$this->isShowInVideoLibrary = $isShowInVideoLibrary;
return $this;
}
public function getIsSessionAutoSwitch(): ?bool
{
return $this->isSessionAutoSwitch;
}
public function setIsSessionAutoSwitch(?bool $isSessionAutoSwitch): self
{
$this->isSessionAutoSwitch = $isSessionAutoSwitch;
return $this;
}
/**
* @return Collection|User[]
*/
public function getSpeakers(): Collection
{
return $this->speakers;
}
public function addSpeaker(User $speaker): self
{
if (!$this->speakers->contains($speaker)) {
$this->speakers[] = $speaker;
}
return $this;
}
public function removeSpeaker(User $speaker): self
{
$this->speakers->removeElement($speaker);
return $this;
}
public function removeAllSpeakers(): self
{
foreach ($this->speakers as $speaker) {
$this->speakers->removeElement($speaker);
}
return $this;
}
public function getSpeakersName(): Collection
{
$names = [];
foreach ($this->speakers as $speaker) {
$names[] = $speaker;
}
return $names;
}
/**
* @return Collection|User[]
*/
public function getModerators(): Collection
{
return $this->moderators;
}
public function addModerator(User $moderator): self
{
if (!$this->moderators->contains($moderator)) {
$this->moderators[] = $moderator;
}
return $this;
}
public function removeModerator(User $moderator): self
{
$this->moderators->removeElement($moderator);
return $this;
}
public function removeAllModerators(): self
{
foreach ($this->moderators as $moderator) {
$this->moderators->removeElement($moderator);
}
return $this;
}
public function getModeratorsName(): Collection
{
$names = [];
foreach ($this->moderators as $moderator) {
$names[] = $moderator;
}
return $names;
}
public function getStreamType(): ?string
{
return $this->streamType;
}
public function setStreamType(?string $streamType): self
{
$this->streamType = $streamType;
return $this;
}
public function getZoomUrl(): ?string
{
return $this->zoomUrl;
}
public function setZoomUrl(?string $zoomUrl): self
{
$this->zoomUrl = $zoomUrl;
return $this;
}
public function getZoomMeetingNumber(): ?string
{
return $this->zoomMeetingNumber;
}
public function setZoomMeetingNumber(?string $zoomMeetingNumber): self
{
$this->zoomMeetingNumber = $zoomMeetingNumber;
return $this;
}
public function getZoomMeetingPassword(): ?string
{
return $this->zoomMeetingPassword;
}
public function setZoomMeetingPassword(?string $zoomMeetingPassword): self
{
$this->zoomMeetingPassword = $zoomMeetingPassword;
return $this;
}
public function getWebexUrl(): ?string
{
return $this->webexUrl;
}
public function setWebexUrl(?string $webexUrl): self
{
$this->webexUrl = $webexUrl;
return $this;
}
public function getWebexMeetingPassword(): ?string
{
return $this->webexMeetingPassword;
}
public function setWebexMeetingPassword(?string $webexMeetingPassword): self
{
$this->webexMeetingPassword = $webexMeetingPassword;
return $this;
}
public function getCardSize(): ?string
{
return $this->cardSize;
}
public function setCardSize(?string $cardSize): self
{
$this->cardSize = $cardSize;
return $this;
}
public function getCardType(): ?string
{
return $this->cardType;
}
public function setCardType(?string $cardType): self
{
$this->cardType = $cardType;
return $this;
}
public function getOrd(): ?int
{
return $this->ord;
}
public function setOrd(?int $ord): self
{
$this->ord = $ord;
return $this;
}
public function getIds()
{
return $this->ids;
}
public function setIds($ids)
{
$this->ids = $ids;
return $this;
}
/**
* @return Collection|UserGroup[]
*/
public function getUserGroups(): Collection
{
return $this->userGroups;
}
/**
* @Groups({"Session:EL"})
* @SerializedName("groups")
*/
public function getUserGroupsArray()
{
$groups = [];
foreach ($this->userGroups as $group) {
if (!$group->getIsGenerated()) {
$groups[] = $group->getId();
}
}
return $groups;
}
public function addUserGroup(UserGroup $userGroup): self
{
if (!$this->userGroups->contains($userGroup)) {
$this->userGroups[] = $userGroup;
}
return $this;
}
public function setUserGroups($userGroups): self
{
$this->userGroups = $userGroups;
return $this;
}
public function removeUserGroup(UserGroup $userGroup): self
{
$this->userGroups->removeElement($userGroup);
return $this;
}
public function removeAllUserGroups(): self
{
foreach ($this->userGroups as $userGroup) {
$this->removeUserGroup($userGroup);
}
return $this;
}
public function getIsReply(): ?bool
{
return $this->isReply;
}
public function setIsReply(?bool $isReply): self
{
$this->isReply = $isReply;
return $this;
}
public function getIsLive(): ?bool
{
/*
if (
$this->getStart() && $this->getCurrentTime() >= $this->getStart()
&& $this->getEnd() && $this->getCurrentTime() < $this->getEnd()
) {
return true;
}
return false;
*/
return $this->isLive;
}
public function setIsLive(?bool $isLive): self
{
$this->isLive = $isLive;
return $this;
}
/**
* @Groups({"Session:Read", "Session:GetItemDetail", "ElTask:Read"})
*/
public function getCurrentTime()
{
return new \DateTime();
}
/**
* @Groups({"Session:Read", "Session:GetItemDetail"})
*/
public function getZoomSignature(): ?string
{
if (!$this->container) {
return false;
}
$isZoomEnable = $this->container->getConfiguration('isZoomEnable');
$zoomKey = $this->container->getConfiguration('zoomKey');
$zoomSecret = $this->container->getConfiguration('zoomSecret');
if ($isZoomEnable && $zoomKey && $zoomSecret && $this->zoomMeetingNumber) {
return $this->generateZoomSDKSignature($zoomKey, $zoomSecret, $this->zoomMeetingNumber);
}
return false;
}
private function generateZoomSignature($apiKey, $apiSecret, $meetingNumber, $role = 0)
{
$time = time() * 1000 - 30000;
$data = base64_encode($apiKey . $meetingNumber . $time . $role);
$hash = hash_hmac('sha256', $data, $apiSecret, true);
$signature = $apiKey . "." . $meetingNumber . "." . $time . "." . $role . "." . base64_encode($hash);
return rtrim(strtr(base64_encode($signature), '+/', '-_'), '=');
}
private function generateZoomSDKSignature($apiKey, $apiSecret, $meetingNumber, $role = 0)
{
$iat = time() - 30;
$exp = $iat + 60 * 60 * 2;
$payload = [
'sdkKey' => $apiKey,
'mn' => $meetingNumber,
'role' => $role,
'iat' => $iat,
'exp' => $exp,
'tokenExp' => $exp
];
return JWT::encode($payload, $apiSecret, 'HS256');
}
/**
* @return Collection|SessionQuestion[]
*/
public function getSessionQuestions(): Collection
{
return $this->sessionQuestions;
}
public function addSessionQuestion(SessionQuestion $sessionQuestion): self
{
if (!$this->sessionQuestions->contains($sessionQuestion)) {
$this->sessionQuestions[] = $sessionQuestion;
$sessionQuestion->setSession($this);
}
return $this;
}
public function removeSessionQuestion(SessionQuestion $sessionQuestion): self
{
if ($this->sessionQuestions->removeElement($sessionQuestion)) {
// set the owning side to null (unless already changed)
if ($sessionQuestion->getSession() === $this) {
$sessionQuestion->setSession(null);
}
}
return $this;
}
public function getIsQuestionEnable(): ?bool
{
return $this->isQuestionEnable;
}
public function setIsQuestionEnable(?bool $isQuestionEnable): self
{
$this->isQuestionEnable = $isQuestionEnable;
return $this;
}
public function getIsAnswerEnable(): ?bool
{
return $this->isAnswerEnable;
}
public function setIsAnswerEnable(?bool $isAnswerEnable): self
{
$this->isAnswerEnable = $isAnswerEnable;
return $this;
}
public function getIsQuestionModerated(): ?bool
{
return $this->isQuestionModerated;
}
public function setIsQuestionModerated(?bool $isQuestionModerated): self
{
$this->isQuestionModerated = $isQuestionModerated;
return $this;
}
public function getIsAskSpeakerEnable(): ?bool
{
return $this->isAskSpeakerEnable;
}
public function setIsAskSpeakerEnable(?bool $isAskSpeakerEnable): self
{
$this->isAskSpeakerEnable = $isAskSpeakerEnable;
return $this;
}
public function getIsAskSpeakerPublicEnable(): ?bool
{
return $this->isAskSpeakerPublicEnable;
}
public function setIsAskSpeakerPublicEnable(?bool $isAskSpeakerPublicEnable): self
{
$this->isAskSpeakerPublicEnable = $isAskSpeakerPublicEnable;
return $this;
}
/**
* @return Collection|WatchTime[]
*/
public function getWatchTimes(): Collection
{
return $this->watchTimes;
}
public function addWatchTime(WatchTime $watchTime): self
{
if (!$this->watchTimes->contains($watchTime)) {
$this->watchTimes[] = $watchTime;
$watchTime->setSession($this);
}
return $this;
}
public function removeWatchTime(WatchTime $watchTime): self
{
if ($this->watchTimes->removeElement($watchTime)) {
// set the owning side to null (unless already changed)
if ($watchTime->getSession() === $this) {
$watchTime->setSession(null);
}
}
return $this;
}
public function getIsSendReminder(): ?bool
{
return $this->isSendReminder;
}
public function setIsSendReminder(?bool $isSendReminder): self
{
$this->isSendReminder = $isSendReminder;
return $this;
}
/**
* @return Collection|CommonComment[]
*/
public function getCommonComments(): Collection
{
return $this->commonComments;
}
public function addCommonComment(CommonComment $commonComment): self
{
if (!$this->commonComments->contains($commonComment)) {
$this->commonComments[] = $commonComment;
$commonComment->setSession($this);
}
return $this;
}
public function removeCommonComment(CommonComment $commonComment): self
{
if ($this->commonComments->removeElement($commonComment)) {
// set the owning side to null (unless already changed)
if ($commonComment->getSession() === $this) {
$commonComment->setSession(null);
}
}
return $this;
}
public function getIsPostEnable()
{
return true;
}
public function getPostText()
{
$postText = [];
foreach ($this->getTranslations() as $translation) {
$postText[] = $translation->getTitle();
}
return implode('###', $postText);
}
public function getPostPoster()
{
return $this->getImageName();
}
public function getMetadataTranslation()
{
$translations = [];
foreach ($this->getTranslations() as $translation) {
$translations[] = [
$translation->getLocale() => [
'title' => $translation->getTitle(),
'description' => $translation->getDescription(),
'streamUrl' => $translation->getStreamUrl()
]
];
}
return $translations;
}
public function getPostMetadata()
{
return [
'session' => [
'id' => $this->getId(),
'translations' => $this->getMetadataTranslation(),
'tags' => $this->getTagsArray(),
'sessionCategory' => $this->getSessionCategory() ? $this->getSessionCategory()->getMeta() : null,
'start' => EsUtil::convertToUTCTime($this->getStart())->format('Y-m-d H:i:s')
],
'conference' => [
'id' => $this->getConference()->getId(),
'translations' => $this->getConference()->getMetadataTranslation()
]
];
}
public function getPostUserGroups()
{
return $this->getUserGroups();
}
public function getPostSource()
{
return CommonComment::SOURCE_SESSION;
}
public function getPostSubSource()
{
return Newsfeed::POSTSUBTYPE_SESSION;
}
public function getMeta(): ?array
{
return $this->meta;
}
public function setMeta(?array $meta): self
{
$this->meta = $meta;
return $this;
}
public function getSelfMeta()
{
$selfMeta = [
'speakers' => [],
'moderators' => []
];
foreach ($this->getSpeakers() as $speaker) {
$selfMeta['speakers'][] = $speaker->getMetadata();
}
foreach ($this->getModerators() as $moderator) {
$selfMeta['moderators'][] = $moderator->getMetadata();
}
return $selfMeta;
}
public function getVideoGalleryTranslations()
{
$translations = [];
foreach ($this->getTranslations() as $translation) {
$translations[] = new VideoGalleryTranslation($translation->getLocale(), $translation->getTitle(), $translation->getDescription());
}
return $translations;
}
public function getVideoGalleryType()
{
return VideoGallery::VIDEOGALLERYTYPE_SESSION;
}
public function getVideoGalleryTypeId()
{
return $this->getId();
}
public function getVideoGalleryStreamType()
{
return $this->getStreamType();
}
public function getVideoGalleryMetadata()
{
$translations = [];
foreach ($this->getTranslations() as $translation) {
$translations[] = [
$translation->getLocale() => [
'streamUrl' => $translation->getStreamUrl()
]
];
}
$totalChapters = $this->getSessionChapters()?->count();
return [
'session' => [
'id' => $this->getId(),
'translations' => $translations,
'streamType' => $this->getStreamType(),
'zoomUrl' => $this->getZoomUrl(),
'zoomMeetingNumber' => $this->getZoomMeetingNumber(),
'zoomMeetingPassword' => $this->getZoomMeetingPassword(),
'webexUrl' => $this->getWebexUrl(),
'webexMeetingPassword' => $this->getWebexMeetingPassword(),
'imageName' => $this->getImageName(),
'hasChapter' => $totalChapters ? true : false
],
'conference' => [
'id' => $this->getConference()->getId(),
'translations' => $this->getConference()->getMetadataTranslation()
]
];
}
public function getVideoGallerySpeakers()
{
return $this->getSpeakers();
}
public function getVideoGalleryModerators()
{
return $this->getModerators();
}
public function getVideoGalleryTags()
{
return $this->getSessionTags();
}
public function getVideoGalleryUserGroups()
{
return $this->getUserGroups();
}
public function getVideoGalleryChapters()
{
return $this->getSessionChapters();
}
public function getVideoGalleryDocs()
{
return $this->getSessionDocs();
}
public function getVideoGalleryCommentEnable()
{
return $this->getIsCommentEnable();
}
public function getClone(Session $source = null): self
{
if (empty($source)) {
$source = $this;
}
$target = new Session();
$target
->setStart($source->getStart())
->setEnd($source->getEnd())
->setImageName($source->getImageName())
->setStreamType($source->getStreamType())
->setIsVisible($source->getIsVisible())
->setIsCommentEnable($source->getIsCommentEnable())
->setIsCommentModerated($source->getIsCommentModerated())
->setIsSharingEnable($source->getIsSharingEnable())
->setIsLikeEnable($source->getIsLikeEnable())
->setIsJoinRequired($source->getIsJoinRequired())
->setIsSessionPublic($source->getIsSessionPublic())
->setIsExternalLinkEnable($source->getIsExternalLinkEnable())
->setExternalLinkLabel($source->getExternalLinkLabel())
->setExternalLinkUrl($source->getExternalLinkUrl())
->setIsShowInVideoLibrary($source->getIsShowInVideoLibrary())
->setIsSessionAutoSwitch($source->getIsSessionAutoSwitch())
->setZoomUrl($source->getZoomUrl())
->setZoomMeetingNumber($source->getZoomMeetingNumber())
->setZoomMeetingPassword($source->getZoomMeetingPassword())
->setWebexUrl($source->getWebexUrl())
->setWebexMeetingPassword($source->getWebexMeetingPassword())
->setCardSize($source->getCardSize())
->setCardType($source->getCardType())
->setOrd($source->getOrd())
->setIsReply($source->getIsReply())
->setIsLive($source->getIsLive())
->setIsQuestionEnable($source->getIsQuestionEnable())
->setIsAnswerEnable($source->getIsAnswerEnable())
->setIsQuestionModerated($source->getIsQuestionModerated())
->setIsAskSpeakerEnable($source->getIsAskSpeakerEnable())
->setIsSendReminder($source->getIsSendReminder())
->setSessionCategory($source->getSessionCategory())
->setConference($source->getConference())
->setBulletPoints($source->getBulletPoints())
->setContainer($source->getContainer())
;
foreach ($source->getTranslations() as $s) {
$newT = new SessionTranslation();
$newT
->setTitle($s->getTitle())
->setDescription($s->getDescription())
->setStreamUrl($s->getStreamUrl())
->setLocale($s->getLocale())
;
$target->addTranslation($newT);
}
foreach ($source->getSpeakers() as $s) {
$target->addSpeaker($s);
}
foreach ($source->getModerators() as $s) {
$target->addModerator($s);
}
foreach ($source->getSessionTags() as $s) {
$target->addSessionTag($s);
}
foreach ($source->getSessionDocs() as $s) {
$target->addSessionDoc($s);
}
foreach ($source->getUserGroups() as $s) {
$target->addUserGroup($s);
}
return $target;
}
public function getIsShowPublic(): ?bool
{
return $this->isShowPublic;
}
public function setIsShowPublic(?bool $isShowPublic): self
{
$this->isShowPublic = $isShowPublic;
return $this;
}
public function getTotalReactions(): ?int
{
return $this->totalReactions;
}
public function setTotalReactions(?int $totalReactions): self
{
$this->totalReactions = $totalReactions;
return $this;
}
public function getTotalReactionsByType(): ?array
{
return $this->totalReactionsByType;
}
public function setTotalReactionsByType(?array $totalReactionsByType): self
{
$this->totalReactionsByType = $totalReactionsByType;
return $this;
}
public function getIsSessionReactionEnable(): ?bool
{
return $this->isSessionReactionEnable;
}
public function setIsSessionReactionEnable(?bool $isSessionReactionEnable): self
{
$this->isSessionReactionEnable = $isSessionReactionEnable;
return $this;
}
public function getDelay()
{
return $this->delay;
}
public function setDelay($delay)
{
$this->delay = $delay;
return $this;
}
/**
* @return Collection<int, SessionChapter>
*/
public function getSessionChapters(): Collection
{
return $this->sessionChapters;
}
public function addSessionChapter(SessionChapter $sessionChapter): self
{
if (!$this->sessionChapters->contains($sessionChapter)) {
$this->sessionChapters[] = $sessionChapter;
$sessionChapter->setSession($this);
}
return $this;
}
public function removeSessionChapter(SessionChapter $sessionChapter): self
{
if ($this->sessionChapters->removeElement($sessionChapter)) {
// set the owning side to null (unless already changed)
if ($sessionChapter->getSession() === $this) {
$sessionChapter->setSession(null);
}
}
return $this;
}
public function getBulletPoints(): ?array
{
if ($this->bulletPoints === null) {
$this->bulletPoints = [];
}
return $this->bulletPoints;
}
public function setBulletPoints(?array $bulletPoints): self
{
if (!is_array($bulletPoints)) {
return $this;
}
$this->bulletPoints = $bulletPoints;
return $this;
}
public function getVideoGallery(): ?VideoGallery
{
return $this->videoGallery;
}
public function setVideoGallery(?VideoGallery $videoGallery): self
{
$this->videoGallery = $videoGallery;
return $this;
}
public function getIsNotConsiderForCertificate(): ?bool
{
return $this->isNotConsiderForCertificate;
}
public function setIsNotConsiderForCertificate(?bool $isNotConsiderForCertificate): self
{
$this->isNotConsiderForCertificate = $isNotConsiderForCertificate;
return $this;
}
/**
* @return Collection|VoteQuestion[]
*/
public function getVoteQuestions(): Collection
{
return $this->voteQuestions;
}
public function addVoteQuestion(VoteQuestion $voteQuestion): self
{
if (!$this->voteQuestions->contains($voteQuestion)) {
$this->voteQuestions[] = $voteQuestion;
$voteQuestion->setSession($this);
}
return $this;
}
public function removeVoteQuestion(VoteQuestion $voteQuestion): self
{
if ($this->voteQuestions->removeElement($voteQuestion)) {
// set the owning side to null (unless already changed)
if ($voteQuestion->getSession() === $this) {
$voteQuestion->setSession(null);
}
}
return $this;
}
public function getOldId(): ?int
{
return $this->oldId;
}
public function setOldId(?int $oldId): self
{
$this->oldId = $oldId;
return $this;
}
public function getShortCode(): ?string
{
return $this->shortCode;
}
public function setShortCode(?string $shortCode): self
{
$this->shortCode = $shortCode;
return $this;
}
/**
* Get the value of currentId
*/
public function getCurrentId()
{
return $this->currentId;
}
/**
* Set the value of currentId
*
* @return self
*/
public function setCurrentId($currentId)
{
$this->currentId = $currentId;
return $this;
}
/**
* Get the value of nextSession
*/
public function getNextSession()
{
return $this->nextSession;
}
/**
* Set the value of nextSession
*
* @return self
*/
public function setNextSession($nextSession)
{
$this->nextSession = $nextSession;
return $this;
}
public function getLastExtendAt(): ?\DateTimeInterface
{
return $this->lastExtendAt;
}
public function setLastExtendAt(?\DateTimeInterface $lastExtendAt): self
{
$this->lastExtendAt = $lastExtendAt;
return $this;
}
public function getIsLastOfTheDay(): ?bool
{
return $this->isLastOfTheDay;
}
public function setIsLastOfTheDay(?bool $isLastOfTheDay): self
{
$this->isLastOfTheDay = $isLastOfTheDay;
return $this;
}
/**
* @Groups({"Session:EL"})
*/
public function getCntId()
{
return $this->container->getId();
}
/**
* @Groups({"Session:EL"})
*/
public function getCategory()
{
return $this->getSessionCategory();
}
public function isIsOnsite(): ?bool
{
return $this->isOnsite;
}
public function setIsOnsite(?bool $isOnsite): self
{
$this->isOnsite = $isOnsite;
return $this;
}
}