parent
1ac1db6173
commit
d1b21eaf42
|
@ -243,11 +243,15 @@ class Event
|
|||
*/
|
||||
public static function store(array $arr): int
|
||||
{
|
||||
$guid = $arr['guid'] ?? '' ?: System::createUUID();
|
||||
$uri = $arr['uri'] ?? '' ?: Item::newURI($guid);
|
||||
$event = [
|
||||
'id' => intval($arr['id'] ?? 0),
|
||||
'uid' => intval($arr['uid'] ?? 0),
|
||||
'cid' => intval($arr['cid'] ?? 0),
|
||||
'guid' => ($arr['guid'] ?? '') ?: System::createUUID(),
|
||||
'guid' => $guid,
|
||||
'uri' => $uri,
|
||||
'uri-id' => ItemURI::insert(['uri' => $uri, 'guid' => $guid]),
|
||||
'type' => ($arr['type'] ?? '') ?: 'event',
|
||||
'summary' => $arr['summary'] ?? '',
|
||||
'desc' => $arr['desc'] ?? '',
|
||||
|
@ -263,8 +267,6 @@ class Event
|
|||
'finish' => DateTimeFormat::utc(($arr['finish'] ?? '') ?: DBA::NULL_DATETIME),
|
||||
];
|
||||
|
||||
$event['uri'] = ($arr['uri'] ?? '') ?: Item::newURI($event['guid']);
|
||||
$event['uri-id'] = ItemURI::insert(['uri' => $event['uri'], 'guid' => $event['guid']]);
|
||||
|
||||
if ($event['finish'] < DBA::NULL_DATETIME) {
|
||||
$event['finish'] = DBA::NULL_DATETIME;
|
||||
|
|
Loading…
Reference in New Issue
Block a user