src/Entity/JournalView.php line 35

  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\ORM\Mapping as ORM,
  4.     Doctrine\DBAL\Types\Types;
  5. use Symfony\Component\Serializer\Annotation\Groups,
  6.     Symfony\Component\Validator\Constraints as Assert;
  7. use ApiPlatform\Metadata\ApiProperty,
  8.     ApiPlatform\Metadata\ApiResource,
  9.     ApiPlatform\Metadata\Get;
  10. use App\Entity\Trait\IdTrait,
  11.     App\Entity\Trait\UuidTrait,
  12.     App\Repository\JournalViewRepository;
  13. use App\Doctrine\DBAL\Types\AuthorPropertiesType,
  14.     App\Enum\JournalAffiliationLogoType,
  15.     App\Enum\JournalColorAccent,
  16.     App\Enum\AlertType,
  17.     App\Enum\JournalPageTemplate,
  18.     App\Enum\JournalCoverType,
  19.     App\Enum\Font,
  20.     App\Enum\AuthorProperty;
  21. use App\Doctrine\DBAL\Types\JournalScientificCouncilMemberPropertiesType;
  22. use App\Enum\JournalScientificCouncilMemberProperty;
  23. #[ApiResource(
  24.     security'is_granted("' Journal::class . '")',
  25.     operations: [ new Get() ],
  26.     extraProperties: ['standard_put' => false],
  27. )]
  28. #[ORM\Entity(repositoryClassJournalViewRepository::class)]
  29. class JournalView
  30. {
  31.     use IdTrait,
  32.         UuidTrait;
  33.     #[ApiProperty(description'Parent')]
  34.     #[ORM\OneToOne(targetEntityJournal::class, inversedBy'view')]
  35.     #[ORM\JoinColumn(onDelete'cascade'nullablefalse)]
  36.     private Journal $parent;
  37.     #[ApiProperty(description'Cover type'writableLinkfalse)]
  38.     #[Groups(['read:' Journal::class, 'write'])]
  39.     #[ORM\Column(
  40.         typeTypes::STRING,
  41.         enumTypeJournalCoverType::class,
  42.         length255,
  43.         options: ['default' => JournalCoverType::CURRENT_ISSUE]
  44.     )]
  45.     private JournalCoverType $coverType JournalCoverType::CURRENT_ISSUE;
  46.     #[ApiProperty(description'Template'writableLinkfalse)]
  47.     #[Groups(['read:' Journal::class, 'write'])]
  48.     #[ORM\Column(
  49.         typeTypes::STRING,
  50.         enumTypeJournalPageTemplate::class,
  51.         length255,
  52.         options: ['default' => JournalPageTemplate::TEMPLATE_1]
  53.     )]
  54.     private JournalPageTemplate $template JournalPageTemplate::TEMPLATE_1;
  55.     #[ApiProperty(description'Is affiliation visible in header')]
  56.     #[Groups(['read:' Journal::class, 'write'])]
  57.     #[ORM\Column(typeTypes::BOOLEANoptions: ['default' => true])]
  58.     private bool $isAffiliationVisibleInHeader true;
  59.     #[ApiProperty(description'Alert A: is visible')]
  60.     #[Groups(['read:' Journal::class, 'write'])]
  61.     #[ORM\Column(typeTypes::BOOLEANoptions: ['default' => false])]
  62.     private bool $alertAIsVisible false;
  63.     #[ApiProperty(description'Alert A: type'writableLinkfalse)]
  64.     #[Groups(['read:' Journal::class, 'write'])]
  65.     #[ORM\Column(
  66.         typeTypes::STRING,
  67.         enumTypeAlertType::class,
  68.         length255,
  69.         options: ['default' => AlertType::ALERT]
  70.     )]
  71.     private AlertType $alertAType AlertType::ALERT;
  72.     #[ApiProperty(description'Alert A: is take off active')]
  73.     #[Groups(['read:' Journal::class, 'write'])]
  74.     // #[Assert\Expression(
  75.     //     expression: '! value || this.getAlertATakeOffDateTime()',
  76.     //     message: 'Take off date time must be set before activating.'
  77.     // )]
  78.     #[ORM\Column(typeTypes::BOOLEANoptions: ['default' => false])]
  79.     private bool $alertAIsTakeOffActive false;
  80.     #[ApiProperty(description'Alert A: take off date and time')]
  81.     #[Groups(['read:' Journal::class, 'write'])]
  82.     // #[Assert\GreaterThan('tomorrow')]
  83.     #[ORM\Column(typeTypes::DATETIME_MUTABLEnullabletrue)]
  84.     private ?\DateTimeInterface $alertATakeOffDateTime null;
  85.     #[ApiProperty(description'Alert B: is visible')]
  86.     #[Groups(['read:' Journal::class, 'write'])]
  87.     #[ORM\Column(typeTypes::BOOLEANoptions: ['default' => false])]
  88.     private bool $alertBIsVisible false;
  89.     #[ApiProperty(description'Alert B: type'writableLinkfalse)]
  90.     #[Groups(['read:' Journal::class, 'write'])]
  91.     #[ORM\Column(
  92.         typeTypes::STRING,
  93.         enumTypeAlertType::class,
  94.         length255,
  95.         options: ['default' => AlertType::ALERT]
  96.     )]
  97.     private AlertType $alertBType AlertType::ALERT;
  98.     #[ApiProperty(description'Alert B: is take off active')]
  99.     #[Groups(['read:' Journal::class, 'write'])]
  100.     // #[Assert\Expression(
  101.     //     expression: '! value || this.getAlertBTakeOffDateTime()',
  102.     //     message: 'Take off date time must be set before activating.'
  103.     // )]
  104.     #[ORM\Column(typeTypes::BOOLEANoptions: ['default' => false])]
  105.     private bool $alertBIsTakeOffActive false;
  106.     #[ApiProperty(description'Alert B: take off date and time')]
  107.     #[Groups(['read:' Journal::class, 'write'])]
  108.     // #[Assert\GreaterThan('tomorrow')]
  109.     #[ORM\Column(typeTypes::DATETIME_MUTABLEnullabletrue)]
  110.     private ?\DateTimeInterface $alertBTakeOffDateTime null;
  111.     #[ApiProperty(description'Has badge')]
  112.     #[Groups(['read:' Journal::class, 'write'])]
  113.     #[ORM\Column(typeTypes::BOOLEANoptions: ['default' => false])]
  114.     private bool $hasBadge false;
  115.     #[ApiProperty(description'Affiliation logo type'writableLinkfalse)]
  116.     #[Groups(['read:' Journal::class, 'write'])]
  117.     #[ORM\Column(
  118.         typeTypes::STRING,
  119.         enumTypeJournalAffiliationLogoType::class,
  120.         length255,
  121.         options: ['default' => JournalAffiliationLogoType::HIDDEN]
  122.     )]
  123.     private JournalAffiliationLogoType $affiliationLogoType JournalAffiliationLogoType::HIDDEN;
  124.     #[ApiProperty(description'Header background color')]
  125.     #[Groups(['read:' Journal::class, 'write'])]
  126.     #[Assert\NotNull]
  127.     #[Assert\CssColor]
  128.     #[ORM\Column(typeTypes::STRINGlength255options: ['default' => '#5E9959'])]
  129.     private string $headerBgColor '#5E9959';
  130.     #[ApiProperty(description'Header text color')]
  131.     #[Groups(['read:' Journal::class, 'write'])]
  132.     #[Assert\NotNull]
  133.     #[Assert\CssColor]
  134.     #[ORM\Column(typeTypes::STRINGlength255options: ['default' => '#fff'])]
  135.     private string $headerTextColor '#fff';
  136.     #[ApiProperty(description'Header text font'writableLinkfalse)]
  137.     #[Groups(['read:' Journal::class, 'write'])]
  138.     #[ORM\Column(
  139.         typeTypes::STRING,
  140.         enumTypeFont::class,
  141.         length255,
  142.         options: ['default' => Font::ARIAL]
  143.     )]
  144.     private Font $headerTextFont Font::ARIAL;
  145.     #[ApiProperty(description'Menu background color')]
  146.     #[Groups(['read:' Journal::class, 'write'])]
  147.     #[Assert\NotNull]
  148.     #[Assert\CssColor]
  149.     #[ORM\Column(typeTypes::STRINGlength255options: ['default' => '#000'])]
  150.     private string $menuBgColor '#000';
  151.     #[ApiProperty(description'Menu text color')]
  152.     #[Groups(['read:' Journal::class, 'write'])]
  153.     #[Assert\NotNull]
  154.     #[Assert\CssColor]
  155.     #[ORM\Column(typeTypes::STRINGlength255options: ['default' => '#fff'])]
  156.     private string $menuTextColor '#fff';
  157.     #[ApiProperty(description'Menu text font'writableLinkfalse)]
  158.     #[Groups(['read:' Journal::class, 'write'])]
  159.     #[ORM\Column(
  160.         typeTypes::STRING,
  161.         enumTypeFont::class,
  162.         length255,
  163.         options: ['default' => Font::ARIAL]
  164.     )]
  165.     private Font $menuTextFont Font::ARIAL;
  166.     #[ApiProperty(description'Submenu background color')]
  167.     #[Groups(['read:' Journal::class, 'write'])]
  168.     #[Assert\CssColor]
  169.     #[ORM\Column(typeTypes::STRINGlength255options: ['default' => '#000'])]
  170.     private string $submenuBgColor '#000';
  171.     #[ApiProperty(description'Submenu text color')]
  172.     #[Groups(['read:' Journal::class, 'write'])]
  173.     #[Assert\CssColor]
  174.     #[ORM\Column(typeTypes::STRINGlength255options: ['default' => '#fff'])]
  175.     private string $submenuTextColor '#fff';
  176.     #[ApiProperty(description'Submenu text font'writableLinkfalse)]
  177.     #[Groups(['read:' Journal::class, 'write'])]
  178.     #[ORM\Column(
  179.         typeTypes::STRING,
  180.         enumTypeFont::class,
  181.         length255,
  182.         options: ['default' => Font::ARIAL]
  183.     )]
  184.     private Font $submenuTextFont Font::ARIAL;
  185.     #[ApiProperty(description'Color accent'writableLinkfalse)]
  186.     #[Groups(['read:' Journal::class, 'write'])]
  187.     #[ORM\Column(typeTypes::STRINGenumTypeJournalColorAccent::class, length255nullabletrue)]
  188.     private ?JournalColorAccent $colorAccent null;
  189.     #[ApiProperty(description'Visible editorial group member properties'writableLinkfalse)]
  190.     #[Groups(['read:' Journal::class, 'write'])]
  191.     #[Assert\Choice(callback: [AuthorProperty::class, 'cases'], multipletrue)]
  192.     #[Assert\Unique]
  193.     #[Assert\Count(min1)]
  194.     #[ORM\Column(typeAuthorPropertiesType::NAME)]
  195.     private array $visibleEditorialGroupMemberProperties = [
  196.         AuthorProperty::PREFIX,
  197.         AuthorProperty::NAME,
  198.         AuthorProperty::SURNAME,
  199.         AuthorProperty::AFFILIATION
  200.     ];
  201.     #[ApiProperty(description'Visible scientific council member properties'writableLinkfalse)]
  202.     #[Groups(['read:' Journal::class, 'write'])]
  203.     #[Assert\Choice(callback: [JournalScientificCouncilMemberProperty::class, 'cases'], multipletrue)]
  204.     #[Assert\Unique]
  205.     #[Assert\Count(min1)]
  206.     #[ORM\Column(typeJournalScientificCouncilMemberPropertiesType::NAME)]
  207.     private array $visibleScientificCouncilMemberProperties = [
  208.         JournalScientificCouncilMemberProperty::PREFIX,
  209.         JournalScientificCouncilMemberProperty::NAME,
  210.         JournalScientificCouncilMemberProperty::SURNAME,
  211.         JournalScientificCouncilMemberProperty::AFFILIATION,
  212.         JournalScientificCouncilMemberProperty::ROLE,
  213.         JournalScientificCouncilMemberProperty::ORCID
  214.     ];
  215.     #[ApiProperty(description'Is editorial groups visible in volumes and numbers')]
  216.     #[Groups(['read:' Journal::class, 'write'])]
  217.     #[ORM\Column(typeTypes::BOOLEANoptions: ['default' => true])]
  218.     private bool $isEditorialGroupsVisibleInVolumesAndNumbers true;
  219.     #[ApiProperty(description'Is footer column A visible')]
  220.     #[Groups(['read:' Journal::class, 'write'])]
  221.     #[ORM\Column(typeTypes::BOOLEANoptions: ['default' => false])]
  222.     private bool $isFooterColumnAVisible true;
  223.     #[ApiProperty(description'Is footer column B visible')]
  224.     #[Groups(['read:' Journal::class, 'write'])]
  225.     #[ORM\Column(typeTypes::BOOLEANoptions: ['default' => false])]
  226.     private bool $isFooterColumnBVisible true;
  227.     #[ApiProperty(description'Is footer column C visible')]
  228.     #[Groups(['read:' Journal::class, 'write'])]
  229.     #[ORM\Column(typeTypes::BOOLEANoptions: ['default' => false])]
  230.     private bool $isFooterColumnCVisible true;
  231.     #[ApiProperty(description'Is footer column D visible')]
  232.     #[Groups(['read:' Journal::class, 'write'])]
  233.     #[ORM\Column(typeTypes::BOOLEANoptions: ['default' => false])]
  234.     private bool $isFooterColumnDVisible true;
  235.     public function __construct(Journal $parent)
  236.     {
  237.         $this->setUuid();
  238.         $this->parent $parent;
  239.     }
  240.     public function getParent(): Journal
  241.     {
  242.         return $this->parent;
  243.     }
  244.     public function getCoverType(): JournalCoverType
  245.     {
  246.         return $this->coverType;
  247.     }
  248.     public function setCoverType(JournalCoverType $coverType): self
  249.     {
  250.         $this->coverType $coverType;
  251.         return $this;
  252.     }
  253.     public function getTemplate(): JournalPageTemplate
  254.     {
  255.         return $this->template;
  256.     }
  257.     public function setTemplate(JournalPageTemplate $template): self
  258.     {
  259.         $this->template $template;
  260.         return $this;
  261.     }
  262.     public function getIsAffiliationVisibleInHeader(): bool
  263.     {
  264.         return $this->isAffiliationVisibleInHeader;
  265.     }
  266.     public function setIsAffiliationVisibleInHeader(bool $isAffiliationVisibleInHeader): self
  267.     {
  268.         $this->isAffiliationVisibleInHeader $isAffiliationVisibleInHeader;
  269.         return $this;
  270.     }
  271.     public function getAlertAIsVisible(): bool
  272.     {
  273.         return $this->alertAIsVisible;
  274.     }
  275.     public function setAlertAIsVisible(bool $alertAIsVisible): self
  276.     {
  277.         $this->alertAIsVisible $alertAIsVisible;
  278.         return $this;
  279.     }
  280.     public function getAlertAType(): AlertType
  281.     {
  282.         return $this->alertAType;
  283.     }
  284.     public function setAlertAType(AlertType $alertAType): self
  285.     {
  286.         $this->alertAType $alertAType;
  287.         return $this;
  288.     }
  289.     public function getAlertAIsTakeOffActive(): bool
  290.     {
  291.         return $this->alertAIsTakeOffActive;
  292.     }
  293.     public function setAlertAIsTakeOffActive(bool $alertAIsTakeOffActive): self
  294.     {
  295.         $this->alertAIsTakeOffActive $alertAIsTakeOffActive;
  296.         return $this;
  297.     }
  298.     public function getAlertATakeOffDateTime(): ?\DateTimeInterface
  299.     {
  300.         return $this->alertATakeOffDateTime;
  301.     }
  302.     public function setAlertATakeOffDateTime(?\DateTimeInterface $alertATakeOffDateTime): self
  303.     {
  304.         $this->alertATakeOffDateTime $alertATakeOffDateTime;
  305.         if (! $alertATakeOffDateTime) {
  306.             $this->alertAIsTakeOffActive false;
  307.         }
  308.         return $this;
  309.     }
  310.     public function getAlertBIsVisible(): bool
  311.     {
  312.         return $this->alertBIsVisible;
  313.     }
  314.     public function setAlertBIsVisible(bool $alertBIsVisible): self
  315.     {
  316.         $this->alertBIsVisible $alertBIsVisible;
  317.         return $this;
  318.     }
  319.     public function getAlertBType(): AlertType
  320.     {
  321.         return $this->alertBType;
  322.     }
  323.     public function setAlertBType(AlertType $alertBType): self
  324.     {
  325.         $this->alertBType $alertBType;
  326.         return $this;
  327.     }
  328.     public function getAlertBIsTakeOffActive(): bool
  329.     {
  330.         return $this->alertBIsTakeOffActive;
  331.     }
  332.     public function setAlertBIsTakeOffActive(bool $alertBIsTakeOffActive): self
  333.     {
  334.         $this->alertBIsTakeOffActive $alertBIsTakeOffActive;
  335.         return $this;
  336.     }
  337.     public function getAlertBTakeOffDateTime(): ?\DateTimeInterface
  338.     {
  339.         return $this->alertBTakeOffDateTime;
  340.     }
  341.     public function setAlertBTakeOffDateTime(?\DateTimeInterface $alertBTakeOffDateTime): self
  342.     {
  343.         $this->alertBTakeOffDateTime $alertBTakeOffDateTime;
  344.         if (! $alertBTakeOffDateTime) {
  345.             $this->alertBIsTakeOffActive false;
  346.         }
  347.         return $this;
  348.     }
  349.     private function clearAlert(string $type): self
  350.     {
  351.         $isTakeOffActive 'alert' strtoupper($type) . 'IsTakeOffActive';
  352.         $takeOffDateTime 'alert' strtoupper($type) . 'TakeOffDateTime';
  353.         if (
  354.             ! $this->$isTakeOffActive
  355.             || (new \DateTimeImmutable()) < $this->$takeOffDateTime
  356.         ) {
  357.             return $this;
  358.         }
  359.         $isVisible 'alert' strtoupper($type) . 'IsVisible';
  360.         $this->$isVisible false;
  361.         $this->$isTakeOffActive false;
  362.         $this->$takeOffDateTime null;
  363.         return $this;
  364.     }
  365.     public function clearAlerts(): self
  366.     {
  367.         $this
  368.             ->clearAlert('a')
  369.             ->clearAlert('b');
  370.         return $this;
  371.     }
  372.     public function getHasBadge(): bool
  373.     {
  374.         return $this->hasBadge;
  375.     }
  376.     public function setHasBadge(bool $hasBadge): self
  377.     {
  378.         $this->hasBadge $hasBadge;
  379.         return $this;
  380.     }
  381.     public function getAffiliationLogoType(): JournalAffiliationLogoType
  382.     {
  383.         return $this->affiliationLogoType;
  384.     }
  385.     public function setAffiliationLogoType(JournalAffiliationLogoType $affiliationLogoType): self
  386.     {
  387.         $this->affiliationLogoType $affiliationLogoType;
  388.         return $this;
  389.     }
  390.     public function getHeaderBgColor(): string
  391.     {
  392.         return $this->headerBgColor;
  393.     }
  394.     public function setHeaderBgColor(string $headerBgColor): self
  395.     {
  396.         $this->headerBgColor $headerBgColor;
  397.         return $this;
  398.     }
  399.     public function getHeaderTextColor(): string
  400.     {
  401.         return $this->headerTextColor;
  402.     }
  403.     public function setHeaderTextColor(string $headerTextColor): self
  404.     {
  405.         $this->headerTextColor $headerTextColor;
  406.         return $this;
  407.     }
  408.     public function getHeaderTextFont(): Font
  409.     {
  410.         return $this->headerTextFont;
  411.     }
  412.     public function setHeaderTextFont(Font $headerTextFont): self
  413.     {
  414.         $this->headerTextFont $headerTextFont;
  415.         return $this;
  416.     }
  417.     public function getMenuBgColor(): string
  418.     {
  419.         return $this->menuBgColor;
  420.     }
  421.     public function setMenuBgColor(string $menuBgColor): self
  422.     {
  423.         $this->menuBgColor $menuBgColor;
  424.         return $this;
  425.     }
  426.     public function getMenuTextColor(): string
  427.     {
  428.         return $this->menuTextColor;
  429.     }
  430.     public function setMenuTextColor(string $menuTextColor): self
  431.     {
  432.         $this->menuTextColor $menuTextColor;
  433.         return $this;
  434.     }
  435.     public function getMenuTextFont(): Font
  436.     {
  437.         return $this->menuTextFont;
  438.     }
  439.     public function setMenuTextFont(Font $menuTextFont): self
  440.     {
  441.         $this->menuTextFont $menuTextFont;
  442.         return $this;
  443.     }
  444.     public function getSubmenuBgColor(): string
  445.     {
  446.         return $this->submenuBgColor;
  447.     }
  448.     public function setSubmenuBgColor(string $submenuBgColor): self
  449.     {
  450.         $this->submenuBgColor $submenuBgColor;
  451.         return $this;
  452.     }
  453.     public function getSubmenuTextColor(): string
  454.     {
  455.         return $this->submenuTextColor;
  456.     }
  457.     public function setSubmenuTextColor(string $submenuTextColor): self
  458.     {
  459.         $this->submenuTextColor $submenuTextColor;
  460.         return $this;
  461.     }
  462.     public function getSubmenuTextFont(): Font
  463.     {
  464.         return $this->submenuTextFont;
  465.     }
  466.     public function setSubmenuTextFont(Font $submenuTextFont): self
  467.     {
  468.         $this->submenuTextFont $submenuTextFont;
  469.         return $this;
  470.     }
  471.     public function getColorAccent(): ?JournalColorAccent
  472.     {
  473.         return $this->colorAccent;
  474.     }
  475.     public function setColorAccent(?JournalColorAccent $colorAccent): self
  476.     {
  477.         $this->colorAccent $colorAccent;
  478.         return $this;
  479.     }
  480.     public function getVisibleEditorialGroupMemberProperties(): array
  481.     {
  482.         return $this->visibleEditorialGroupMemberProperties;
  483.     }
  484.     public function setVisibleEditorialGroupMemberProperties(array $visibleEditorialGroupMemberProperties): self
  485.     {
  486.         $this->visibleEditorialGroupMemberProperties $visibleEditorialGroupMemberProperties;
  487.         return $this;
  488.     }
  489.     public function getVisibleScientificCouncilMemberProperties(): array
  490.     {
  491.         return $this->visibleScientificCouncilMemberProperties;
  492.     }
  493.     public function setVisibleScientificCouncilMemberProperties(array $visibleScientificCouncilMemberProperties): self
  494.     {
  495.         $this->visibleScientificCouncilMemberProperties $visibleScientificCouncilMemberProperties;
  496.         return $this;
  497.     }
  498.     public function getIsEditorialGroupsVisibleInVolumesAndNumbers(): bool
  499.     {
  500.         return $this->isEditorialGroupsVisibleInVolumesAndNumbers;
  501.     }
  502.     public function setIsEditorialGroupsVisibleInVolumesAndNumbers(bool $isEditorialGroupsVisibleInVolumesAndNumbers): self
  503.     {
  504.         $this->isEditorialGroupsVisibleInVolumesAndNumbers $isEditorialGroupsVisibleInVolumesAndNumbers;
  505.         return $this;
  506.     }
  507.     public function getIsFooterColumnAVisible(): bool
  508.     {
  509.         return $this->isFooterColumnAVisible;
  510.     }
  511.     public function setIsFooterColumnAVisible(bool $isFooterColumnAVisible): self
  512.     {
  513.         $this->isFooterColumnAVisible $isFooterColumnAVisible;
  514.         return $this;
  515.     }
  516.     public function getIsFooterColumnBVisible(): bool
  517.     {
  518.         return $this->isFooterColumnBVisible;
  519.     }
  520.     public function setIsFooterColumnBVisible(bool $isFooterColumnBVisible): self
  521.     {
  522.         $this->isFooterColumnBVisible $isFooterColumnBVisible;
  523.         return $this;
  524.     }
  525.     public function getIsFooterColumnCVisible(): bool
  526.     {
  527.         return $this->isFooterColumnCVisible;
  528.     }
  529.     public function setIsFooterColumnCVisible(bool $isFooterColumnCVisible): self
  530.     {
  531.         $this->isFooterColumnCVisible $isFooterColumnCVisible;
  532.         return $this;
  533.     }
  534.     public function getIsFooterColumnDVisible(): bool
  535.     {
  536.         return $this->isFooterColumnDVisible;
  537.     }
  538.     public function setIsFooterColumnDVisible(bool $isFooterColumnDVisible): self
  539.     {
  540.         $this->isFooterColumnDVisible $isFooterColumnDVisible;
  541.         return $this;
  542.     }
  543.     public function clone(Journal $parent): self
  544.     {
  545.         $clone = clone $this;
  546.         $clone->id null;
  547.         $clone->setUuid();
  548.         $clone->alertATakeOffDateTime null;
  549.         $clone->alertAIsTakeOffActive false;
  550.         $clone->alertBTakeOffDateTime null;
  551.         $clone->alertBIsTakeOffActive false;
  552.         $clone->parent $parent;
  553.         return $clone;
  554.     }
  555. }