Changeset View
Changeset View
Standalone View
Standalone View
src/applications/calendar/storage/PhabricatorCalendarEvent.php
Show All 18 Lines | implements | ||||
PhabricatorConduitResultInterface { | PhabricatorConduitResultInterface { | ||||
protected $name; | protected $name; | ||||
protected $hostPHID; | protected $hostPHID; | ||||
protected $description; | protected $description; | ||||
protected $isCancelled; | protected $isCancelled; | ||||
protected $isAllDay; | protected $isAllDay; | ||||
protected $icon; | protected $icon; | ||||
protected $mailKey; | |||||
protected $isStub; | protected $isStub; | ||||
protected $isRecurring = 0; | protected $isRecurring = 0; | ||||
protected $seriesParentPHID; | protected $seriesParentPHID; | ||||
protected $instanceOfEventPHID; | protected $instanceOfEventPHID; | ||||
protected $sequenceIndex; | protected $sequenceIndex; | ||||
▲ Show 20 Lines • Show All 319 Lines • ▼ Show 20 Lines | if ($instance_date) { | ||||
->getEpoch(); | ->getEpoch(); | ||||
} | } | ||||
$this->setUTCInstanceEpoch($instance_epoch); | $this->setUTCInstanceEpoch($instance_epoch); | ||||
return $this; | return $this; | ||||
} | } | ||||
public function save() { | public function save() { | ||||
if (!$this->mailKey) { | |||||
$this->mailKey = Filesystem::readRandomCharacters(20); | |||||
} | |||||
$import_uid = $this->getImportUID(); | $import_uid = $this->getImportUID(); | ||||
if ($import_uid !== null) { | if ($import_uid !== null) { | ||||
$index = PhabricatorHash::digestForIndex($import_uid); | $index = PhabricatorHash::digestForIndex($import_uid); | ||||
} else { | } else { | ||||
$index = null; | $index = null; | ||||
} | } | ||||
$this->setImportUIDIndex($index); | $this->setImportUIDIndex($index); | ||||
Show All 25 Lines | protected function getConfiguration() { | ||||
return array( | return array( | ||||
self::CONFIG_AUX_PHID => true, | self::CONFIG_AUX_PHID => true, | ||||
self::CONFIG_COLUMN_SCHEMA => array( | self::CONFIG_COLUMN_SCHEMA => array( | ||||
'name' => 'text', | 'name' => 'text', | ||||
'description' => 'text', | 'description' => 'text', | ||||
'isCancelled' => 'bool', | 'isCancelled' => 'bool', | ||||
'isAllDay' => 'bool', | 'isAllDay' => 'bool', | ||||
'icon' => 'text32', | 'icon' => 'text32', | ||||
'mailKey' => 'bytes20', | |||||
'isRecurring' => 'bool', | 'isRecurring' => 'bool', | ||||
'seriesParentPHID' => 'phid?', | 'seriesParentPHID' => 'phid?', | ||||
'instanceOfEventPHID' => 'phid?', | 'instanceOfEventPHID' => 'phid?', | ||||
'sequenceIndex' => 'uint32?', | 'sequenceIndex' => 'uint32?', | ||||
'isStub' => 'bool', | 'isStub' => 'bool', | ||||
'utcInitialEpoch' => 'epoch', | 'utcInitialEpoch' => 'epoch', | ||||
'utcUntilEpoch' => 'epoch?', | 'utcUntilEpoch' => 'epoch?', | ||||
'utcInstanceEpoch' => 'epoch?', | 'utcInstanceEpoch' => 'epoch?', | ||||
Show All 20 Lines | return array( | ||||
), | ), | ||||
), | ), | ||||
self::CONFIG_SERIALIZATION => array( | self::CONFIG_SERIALIZATION => array( | ||||
'parameters' => self::SERIALIZATION_JSON, | 'parameters' => self::SERIALIZATION_JSON, | ||||
), | ), | ||||
) + parent::getConfiguration(); | ) + parent::getConfiguration(); | ||||
} | } | ||||
public function generatePHID() { | public function getPHIDType() { | ||||
return PhabricatorPHID::generateNewPHID( | return PhabricatorCalendarEventPHIDType::TYPECONST; | ||||
PhabricatorCalendarEventPHIDType::TYPECONST); | |||||
} | } | ||||
public function getMonogram() { | public function getMonogram() { | ||||
return 'E'.$this->getID(); | return 'E'.$this->getID(); | ||||
} | } | ||||
public function getInvitees() { | public function getInvitees() { | ||||
if ($this->getIsGhostEvent() || $this->getIsStub()) { | if ($this->getIsGhostEvent() || $this->getIsStub()) { | ||||
▲ Show 20 Lines • Show All 994 Lines • Show Last 20 Lines |