1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
inboxattachmentmanager.php
См. документацию.
1<?php
2
3
4namespace Bitrix\Calendar\ICal\MailInvitation;
5
6
7use Bitrix\Calendar\ICal\Parser\Calendar;
8use Bitrix\Calendar\ICal\Parser\IcalParserException;
9use Bitrix\Calendar\ICal\Parser\Parser;
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)
Определения parser.php:28