Select all fields
This commit is contained in:
parent
6bb8b63da0
commit
307cfef12b
|
@ -47,13 +47,9 @@ class Fetch extends BaseModule
|
||||||
$guid = $parameters['guid'];
|
$guid = $parameters['guid'];
|
||||||
|
|
||||||
// Fetch the item
|
// 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,
|
$condition = ['origin' => true, 'private' => [Item::PUBLIC, Item::UNLISTED], 'guid' => $guid,
|
||||||
'gravity' => [GRAVITY_PARENT, GRAVITY_COMMENT], 'network' => [Protocol::DFRN, Protocol::DIASPORA]];
|
'gravity' => [GRAVITY_PARENT, GRAVITY_COMMENT], 'network' => [Protocol::DFRN, Protocol::DIASPORA]];
|
||||||
$item = Post::selectFirst($fields, $condition);
|
$item = Post::selectFirst([], $condition);
|
||||||
if (empty($item)) {
|
if (empty($item)) {
|
||||||
$condition = ['guid' => $guid, 'network' => [Protocol::DFRN, Protocol::DIASPORA]];
|
$condition = ['guid' => $guid, 'network' => [Protocol::DFRN, Protocol::DIASPORA]];
|
||||||
$item = Post::selectFirst(['author-link'], $condition);
|
$item = Post::selectFirst(['author-link'], $condition);
|
||||||
|
|
Loading…
Reference in a new issue