Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
inboxattachmentmanager.php
1<?php
2
3
5
6
10
12{
16 private $fileContent;
17
21 private $parser;
22
27 public static function createInstance(string $fileContent): InboxAttachmentManager
28 {
29 return new self($fileContent);
30 }
31
36 public function __construct(string $fileContent)
37 {
38 $this->fileContent = $fileContent;
39 }
40
44 public function parse(): InboxAttachmentManager
45 {
46 try
47 {
48 $this->parser = Parser::createInstance($this->fileContent)
49 ->parse();
50 }
51 catch (IcalParserException $e)
52 {
53 $this->parser = null;
54 }
55
56 return $this;
57 }
58
62 public function getComponent(): ?Calendar
63 {
64 if (empty($this->parser))
65 {
66 return null;
67 }
68
69 return $this->parser->getCalendarComponent();
70 }
71}
static createInstance(string $content)
Definition parser.php:28