Remove all "FileHasObject" edge reads and writes
[phabricator.git] / src / applications / calendar / import / PhabricatorCalendarICSImportEngine.php
blobb0cf9ba2cb6acaadda36778eda41ffbc551b7f80
1 <?php
3 abstract class PhabricatorCalendarICSImportEngine
4 extends PhabricatorCalendarImportEngine {
6 final protected function importICSData(
7 PhabricatorUser $viewer,
8 PhabricatorCalendarImport $import,
9 $data) {
11 $parser = new PhutilICSParser();
13 try {
14 $document = $parser->parseICSData($data);
15 } catch (PhutilICSParserException $ex) {
16 // TODO: In theory, it would be nice to store these in a fully abstract
17 // form so they can be translated at display time. As-is, we'll store the
18 // error messages in whatever language we were using when the parser
19 // failure occurred.
21 $import->newLogMessage(
22 PhabricatorCalendarImportICSLogType::LOGTYPE,
23 array(
24 'ics.code' => $ex->getParserFailureCode(),
25 'ics.message' => $ex->getMessage(),
26 ));
28 $document = null;
31 foreach ($parser->getWarnings() as $warning) {
32 $import->newLogMessage(
33 PhabricatorCalendarImportICSWarningLogType::LOGTYPE,
34 array(
35 'ics.warning.code' => $warning['code'],
36 'ics.warning.line' => $warning['line'],
37 'ics.warning.text' => $warning['text'],
38 'ics.warning.message' => $warning['message'],
39 ));
42 return $this->importEventDocument($viewer, $import, $document);