1<?php 2 3declare(strict_types=1); 4 5/** 6 * Activation-Settings for an LSO 7 * 8 * @author Nils Haagen <nils.haagen@concepts-and-training.de> 9 */ 10class ilLearningSequenceActivation 11{ 12 /** 13 * @var int 14 */ 15 protected $ref_id; 16 17 /** 18 * @var bool 19 */ 20 protected $online; 21 22 /** 23 * @var bool 24 */ 25 protected $effective_online; 26 27 /** 28 * @var \DateTime | null 29 */ 30 protected $activation_start; 31 32 /** 33 * @var \DateTime | null 34 */ 35 protected $activation_end; 36 37 38 public function __construct( 39 int $ref_id, 40 bool $online = false, 41 bool $effective_online = false, 42 \DateTime $activation_start = null, 43 \DateTime $activation_end = null 44 ) { 45 $this->ref_id = $ref_id; 46 $this->online = $online; 47 $this->effective_online = $effective_online; 48 $this->activation_start = $activation_start; 49 $this->activation_end = $activation_end; 50 } 51 52 public function getRefId() : int 53 { 54 return $this->ref_id; 55 } 56 57 public function getIsOnline() : bool 58 { 59 return $this->online; 60 } 61 62 public function withIsOnline(bool $online) : ilLearningSequenceActivation 63 { 64 $clone = clone $this; 65 $clone->online = $online; 66 return $clone; 67 } 68 69 public function getEffectiveOnlineStatus() : bool 70 { 71 return $this->effective_online; 72 } 73 74 /** 75 * @return \DateTime | null 76 */ 77 public function getActivationStart() 78 { 79 return $this->activation_start; 80 } 81 82 public function withActivationStart(\DateTime $activation_start = null) : ilLearningSequenceActivation 83 { 84 $clone = clone $this; 85 $clone->activation_start = $activation_start; 86 return $clone; 87 } 88 89 /** 90 * @return \DateTime | null 91 */ 92 public function getActivationEnd() 93 { 94 return $this->activation_end; 95 } 96 97 public function withActivationEnd(\DateTime $activation_end = null) : ilLearningSequenceActivation 98 { 99 $clone = clone $this; 100 $clone->activation_end = $activation_end; 101 return $clone; 102 } 103} 104