Select all fields

This commit is contained in:
Michael 2021-09-03 04:09:02 +00:00
parent 6bb8b63da0
commit 307cfef12b

View File

@ -47,13 +47,9 @@ class Fetch extends BaseModule
$guid = $parameters['guid'];
// Fetch the item
$fields = [
'uid', 'title', 'body', 'guid', 'contact-id', 'private', 'created', 'received', 'app', 'location', 'coord', 'network',
'gravity', 'event-id', 'resource-id', 'author-link', 'author-avatar', 'author-name', 'plink', 'owner-link', 'uri-id'
];
$condition = ['origin' => true, 'private' => [Item::PUBLIC, Item::UNLISTED], 'guid' => $guid,
'gravity' => [GRAVITY_PARENT, GRAVITY_COMMENT], 'network' => [Protocol::DFRN, Protocol::DIASPORA]];
$item = Post::selectFirst($fields, $condition);
$item = Post::selectFirst([], $condition);
if (empty($item)) {
$condition = ['guid' => $guid, 'network' => [Protocol::DFRN, Protocol::DIASPORA]];
$item = Post::selectFirst(['author-link'], $condition);