| 1: | <?php |
| 2: | declare(strict_types=1); |
| 3: | |
| 4: | namespace om\ICal; |
| 5: | |
| 6: | use DateInterval; |
| 7: | use DateTimeInterface; |
| 8: | use InvalidArgumentException; |
| 9: | use om\ICal\Value\CalAddress; |
| 10: | use om\ICal\Value\Classification; |
| 11: | use om\ICal\Value\DateTimeValue; |
| 12: | use om\ICal\Value\Image; |
| 13: | use om\ICal\Value\Link; |
| 14: | use om\ICal\Value\Period; |
| 15: | use om\ICal\Value\PropertyFactory; |
| 16: | use om\ICal\Value\Relation; |
| 17: | use om\ICal\Value\Status; |
| 18: | use om\RRule\Rule; |
| 19: | |
| 20: | |
| 21: | |
| 22: | |
| 23: | |
| 24: | |
| 25: | final class Journal extends Item { |
| 26: | |
| 27: | |
| 28: | |
| 29: | |
| 30: | |
| 31: | |
| 32: | |
| 33: | |
| 34: | |
| 35: | |
| 36: | |
| 37: | |
| 38: | |
| 39: | |
| 40: | |
| 41: | |
| 42: | |
| 43: | |
| 44: | |
| 45: | |
| 46: | |
| 47: | |
| 48: | public static function new( |
| 49: | ?string $uid = null, |
| 50: | DateTimeInterface|DateTimeValue|string|null $stamp = null, |
| 51: | DateTimeInterface|DateTimeValue|string|null $start = null, |
| 52: | ?string $summary = null, |
| 53: | ?string $description = null, |
| 54: | ?string $url = null, |
| 55: | Status|string|null $status = null, |
| 56: | Classification|string|null $classification = null, |
| 57: | ?int $sequence = null, |
| 58: | iterable $categories = [], |
| 59: | CalAddress|string|null $organizer = null, |
| 60: | iterable $attendees = [], |
| 61: | Rule|string|null $rrule = null, |
| 62: | iterable $rdates = [], |
| 63: | iterable $exdates = [], |
| 64: | DateTimeInterface|DateTimeValue|string|null $recurrenceId = null, |
| 65: | ?string $color = null, |
| 66: | iterable $images = [], |
| 67: | iterable $links = [], |
| 68: | iterable $relatedTo = [], |
| 69: | array $properties = [], |
| 70: | ): self { |
| 71: | $builder = ComponentBuilder::item('VJOURNAL', $uid, $stamp); |
| 72: | $startValue = $builder->start($start); |
| 73: | $builder->recurrence($startValue, $rrule, $rdates, $exdates, $recurrenceId) |
| 74: | ->descriptive(summary: $summary, description: $description, url: $url, classification: $classification, sequence: $sequence, categories: $categories, organizer: $organizer, attendees: $attendees, color: $color, images: $images, links: $links, relatedTo: $relatedTo) |
| 75: | ->status($status); |
| 76: | return new self($builder->build($properties), new Calendar()); |
| 77: | } |
| 78: | |
| 79: | public function duration(): DateInterval { |
| 80: | return new DateInterval('PT0S'); |
| 81: | } |
| 82: | } |
| 83: | |