format; } /** * Sets the import format * * @param 'ical'|'jcal'|'xcal' $value */ public function setFormat(string $value): void { if (!in_array($value, self::FORMATS, true)) { throw new InvalidArgumentException('Format is not valid.'); } $this->format = $value; } /** * Gets whether to supersede existing objects */ public function getSupersede(): bool { return $this->supersede; } /** * Sets whether to supersede existing objects */ public function setSupersede(bool $supersede): void { $this->supersede = $supersede; } /** * Gets how to handle object errors * * @return int 0 - continue, 1 - fail */ public function getErrors(): int { return $this->errors; } /** * Sets how to handle object errors * * @param int $value 0 - continue, 1 - fail * * @template $value of self::ERROR_* */ public function setErrors(int $value): void { if (!in_array($value, CalendarImportOptions::ERROR_OPTIONS, true)) { throw new InvalidArgumentException('Invalid errors option specified'); } $this->errors = $value; } /** * Gets how to handle object validation * * @return int 0 - no validation, 1 - validate and skip on issue, 2 - validate and fail on issue */ public function getValidate(): int { return $this->validate; } /** * Sets how to handle object validation * * @param int $value 0 - no validation, 1 - validate and skip on issue, 2 - validate and fail on issue * * @template $value of self::VALIDATE_* */ public function setValidate(int $value): void { if (!in_array($value, CalendarImportOptions::VALIDATE_OPTIONS, true)) { throw new InvalidArgumentException('Invalid validation option specified'); } $this->validate = $value; } }