createdBy = new NullAccount(); $this->createdAt = new \DateTimeImmutable('now'); } /** * @return int * * @since 1.0.0 */ public function getStatus() : int { return $this->status; } /** * @param int $status Schedule status * * @return self * * @throws InvalidEnumValue * * @since 1.0.0 */ public function setStatus(int $status) : self { if (!ScheduleStatus::isValidValue($status)) { throw new InvalidEnumValue($status); } $this->status = $status; return $this; } /** * @return int * * @since 1.0.0 */ public function getFreqType() : int { return $this->freqType; } /** * @param int $freqType Frequency type * * @return self * * @throws InvalidEnumValue * * @since 1.0.0 */ public function setFreqType(int $freqType) : self { if (!FrequencyType::isValidValue($freqType)) { throw new InvalidEnumValue($freqType); } $this->freqType = $freqType; return $this; } /** * @return int * * @since 1.0.0 */ public function getIntervalType() : int { return $this->patternInterval; } /** * @param int $patternInterval Interval type * * @return self * * @throws InvalidEnumValue * * @since 1.0.0 */ public function setIntervalType(int $patternInterval) : self { if (!IntervalType::isValidValue($patternInterval)) { throw new InvalidEnumValue($patternInterval); } $this->patternInterval = $patternInterval; return $this; } /** * {@inheritdoc} */ public function toArray() : array { return [ 'id' => $this->id, 'uuid' => $this->uid, 'status' => $this->status, 'freqType' => $this->freqType, 'patternInterval' => $this->patternInterval, 'start' => $this->start, 'createdAt' => $this->createdAt, ]; } /** * {@inheritdoc} */ public function jsonSerialize() : mixed { return $this->toArray(); } }