mirror of
https://github.com/friendica/friendica
synced 2024-12-23 08:00:16 +00:00
Changes:
- use local variables
This commit is contained in:
parent
1ac1db6173
commit
d1b21eaf42
1 changed files with 13 additions and 11 deletions
|
@ -243,19 +243,23 @@ class Event
|
||||||
*/
|
*/
|
||||||
public static function store(array $arr): int
|
public static function store(array $arr): int
|
||||||
{
|
{
|
||||||
|
$guid = $arr['guid'] ?? '' ?: System::createUUID();
|
||||||
|
$uri = $arr['uri'] ?? '' ?: Item::newURI($guid);
|
||||||
$event = [
|
$event = [
|
||||||
'id' => intval($arr['id'] ?? 0),
|
'id' => intval($arr['id'] ?? 0),
|
||||||
'uid' => intval($arr['uid'] ?? 0),
|
'uid' => intval($arr['uid'] ?? 0),
|
||||||
'cid' => intval($arr['cid'] ?? 0),
|
'cid' => intval($arr['cid'] ?? 0),
|
||||||
'guid' => ($arr['guid'] ?? '') ?: System::createUUID(),
|
'guid' => $guid,
|
||||||
'type' => ($arr['type'] ?? '') ?: 'event',
|
'uri' => $uri,
|
||||||
'summary' => $arr['summary'] ?? '',
|
'uri-id' => ItemURI::insert(['uri' => $uri, 'guid' => $guid]),
|
||||||
'desc' => $arr['desc'] ?? '',
|
'type' => ($arr['type'] ?? '') ?: 'event',
|
||||||
'location' => $arr['location'] ?? '',
|
'summary' => $arr['summary'] ?? '',
|
||||||
'allow_cid' => $arr['allow_cid'] ?? '',
|
'desc' => $arr['desc'] ?? '',
|
||||||
'allow_gid' => $arr['allow_gid'] ?? '',
|
'location' => $arr['location'] ?? '',
|
||||||
'deny_cid' => $arr['deny_cid'] ?? '',
|
'allow_cid' => $arr['allow_cid'] ?? '',
|
||||||
'deny_gid' => $arr['deny_gid'] ?? '',
|
'allow_gid' => $arr['allow_gid'] ?? '',
|
||||||
|
'deny_cid' => $arr['deny_cid'] ?? '',
|
||||||
|
'deny_gid' => $arr['deny_gid'] ?? '',
|
||||||
'nofinish' => intval($arr['nofinish'] ?? (!empty($arr['start']) && empty($arr['finish']))),
|
'nofinish' => intval($arr['nofinish'] ?? (!empty($arr['start']) && empty($arr['finish']))),
|
||||||
'created' => DateTimeFormat::utc(($arr['created'] ?? '') ?: 'now'),
|
'created' => DateTimeFormat::utc(($arr['created'] ?? '') ?: 'now'),
|
||||||
'edited' => DateTimeFormat::utc(($arr['edited'] ?? '') ?: 'now'),
|
'edited' => DateTimeFormat::utc(($arr['edited'] ?? '') ?: 'now'),
|
||||||
|
@ -263,8 +267,6 @@ class Event
|
||||||
'finish' => DateTimeFormat::utc(($arr['finish'] ?? '') ?: DBA::NULL_DATETIME),
|
'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) {
|
if ($event['finish'] < DBA::NULL_DATETIME) {
|
||||||
$event['finish'] = DBA::NULL_DATETIME;
|
$event['finish'] = DBA::NULL_DATETIME;
|
||||||
|
|
Loading…
Reference in a new issue