}
$params = ['order' => ['id' => true], 'limit' => [$start, $count]];
- $statuses = Item::select(api_user(), Item::DISPLAY_FIELDLIST, $condition, $params);
+ $statuses = Item::selectForUser(api_user(), [], $condition, $params);
$data['status'] = api_format_items(dba::inArray($statuses), $user_info);
}
$params = ['order' => ['id' => true], 'limit' => [$start, $count]];
- $statuses = Item::select(api_user(), Item::DISPLAY_FIELDLIST, $condition, $params);
+ $statuses = Item::selectForUser(api_user(), [], $condition, $params);
$items = dba::inArray($statuses);
}
$params = ['order' => ['iid' => true], 'limit' => [$start, $count]];
- $statuses = Item::selectThread(api_user(), Item::DISPLAY_FIELDLIST, $condition, $params);
+ $statuses = Item::selectThreadForUser(api_user(), Item::DISPLAY_FIELDLIST, $condition, $params);
$r = dba::inArray($statuses);
} else {
}
$params = ['order' => ['id' => true], 'limit' => [$start, $count]];
- $statuses = Item::select(api_user(), Item::DISPLAY_FIELDLIST, $condition, $params);
+ $statuses = Item::selectForUser(api_user(), [], $condition, $params);
$r = dba::inArray($statuses);
}
}
$params = ['order' => ['iid' => true], 'limit' => [$start, $count]];
- $statuses = Item::selectThread(api_user(), Item::DISPLAY_FIELDLIST, $condition, $params);
+ $statuses = Item::selectThreadForUser(api_user(), Item::DISPLAY_FIELDLIST, $condition, $params);
$ret = api_format_items(dba::inArray($statuses), $user_info, false, $type);
$params = [];
}
- $statuses = Item::select(api_user(), Item::DISPLAY_FIELDLIST, $condition, $params);
+ $statuses = Item::selectForUser(api_user(), [], $condition, $params);
/// @TODO How about copying this to above methods which don't check $r ?
if (!DBM::is_result($statuses)) {
}
$params = ['order' => ['id' => true], 'limit' => [$start, $count]];
- $statuses = Item::select(api_user(), Item::DISPLAY_FIELDLIST, $condition, $params);
+ $statuses = Item::selectForUser(api_user(), [], $condition, $params);
if (!DBM::is_result($statuses)) {
throw new BadRequestException("There is no status with id $id.");
logger('API: api_statuses_repeat: '.$id);
$fields = ['body', 'author-name', 'author-link', 'author-avatar', 'guid', 'created', 'plink'];
- $item = Item::selectFirst(api_user(), $fields, ['id' => $id, 'private' => false]);
+ $item = Item::selectFirst($fields, ['id' => $id, 'private' => false]);
if (DBM::is_result($item) && $item['body'] != "") {
if (strpos($item['body'], "[/share]") !== false) {
}
$params = ['order' => ['id' => true], 'limit' => [$start, $count]];
- $statuses = Item::select(api_user(), Item::DISPLAY_FIELDLIST, $condition, $params);
+ $statuses = Item::selectForUser(api_user(), [], $condition, $params);
$ret = api_format_items(dba::inArray($statuses), $user_info, false, $type);
}
$params = ['order' => ['id' => true], 'limit' => [$start, $count]];
- $statuses = Item::select(api_user(), Item::DISPLAY_FIELDLIST, $condition, $params);
+ $statuses = Item::selectForUser(api_user(), [], $condition, $params);
$ret = api_format_items(dba::inArray($statuses), $user_info, true, $type);
$itemid = intval($_REQUEST['id']);
}
- $item = Item::selectFirst(api_user(), Item::DISPLAY_FIELDLIST, ['id' => $itemid, 'uid' => api_user()]);
+ $item = Item::selectFirstForUser(api_user(), [], ['id' => $itemid, 'uid' => api_user()]);
if (!DBM::is_result($item)) {
throw new BadRequestException("Invalid item.");
$condition[] = $max_id;
}
- $statuses = Item::select(api_user(), Item::DISPLAY_FIELDLIST, $condition, $params);
+ $statuses = Item::selectForUser(api_user(), [], $condition, $params);
$ret = api_format_items(dba::inArray($statuses), $user_info, false, $type);
}
}
$params = ['order' => ['id' => true], 'limit' => [$start, $count]];
- $statuses = Item::select(api_user(), Item::DISPLAY_FIELDLIST, $condition, $params);
+ $statuses = Item::selectForUser(api_user(), [], $condition, $params);
$items = api_format_items(dba::inArray($statuses), $user_info, false, $type);
$condition = ["`parent` = ? AND `uid` = ? AND (`verb` = ? OR `type`='photo')",
$item[0]['parent'], api_user(), ACTIVITY_POST];
- $statuses = Item::select(api_user(), Item::DISPLAY_FIELDLIST, $condition);
+ $statuses = Item::selectForUser(api_user(), [], $condition);
// prepare output of comments
$commentData = api_format_items(dba::inArray($statuses), $user_info, false, $type);
$nm->setSeen($note);
if ($note['otype']=='item') {
// would be really better with an ItemsManager and $im->getByID() :-P
- $item = Item::selectFirst(api_user(), Item::DISPLAY_FIELDLIST, ['id' => $note['iid'], 'uid' => api_user()]);
+ $item = Item::selectFirstForUser(api_user(), [], ['id' => $note['iid'], 'uid' => api_user()]);
if (DBM::is_result($$item)) {
// we found the item, return it to the user
$ret = api_format_items([$item], $user_info, false, $type);
if ($block_authors) {
$condition[0] .= "AND NOT `author`.`hidden`";
}
- $thread_items = Item::select(local_user(), Item::DISPLAY_FIELDLIST, $condition, $params);
+ $thread_items = Item::selectForUser(local_user(), [], $condition, $params);
$comments = dba::inArray($thread_items);
$item = null;
if ($params['otype'] === 'item' && $parent_id) {
- $item = Item::selectFirst($params['uid'], [], ['id' => $parent_id]);
+ $item = Item::selectFirstForUser($params['uid'], [], ['id' => $parent_id]);
}
$item_post_type = item_post_type($item);
$condition = ["`parent` = ?", $conv_id];
$params = ['order' => ['author-name' => true]];
- $authors = Item::select(local_user(), ['author-link'], $condition, $params);
+ $authors = Item::selectForUser(local_user(), ['author-link'], $condition, $params);
$item_authors = [];
while ($author = dba::fetch($authors)) {
$item_authors[$author['author-link']] = $author['author-link'];
$condition = ["`item`.`parent-uri` = (SELECT `parent-uri` FROM `item` WHERE `id` = ?)
AND `item`.`uid` IN (0, ?) " . $sql_extra, $item_id, local_user()];
$params = ['order' => ['uid', 'parent' => true, 'gravity', 'id']];
- $r = Item::select(local_user(), Item::DISPLAY_FIELDLIST, $condition, $params);
+ $r = Item::selectForUser(local_user(), [], $condition, $params);
if (!DBM::is_result($r)) {
notice(L10n::t('Item not found.') . EOL);
}
$params = ['order' => ['id' => true], 'limit' => [$a->pager['start'], $a->pager['itemspage']]];
- $result = Item::select(local_user(), Item::DISPLAY_FIELDLIST, $condition, $params);
+ $result = Item::selectForUser(local_user(), [], $condition, $params);
$items = dba::inArray($result);
$condition = ['unseen' => true, 'uid' => local_user()];
$params = ['order' => ['created' => true],
'limit' => [$a->pager['start'], $a->pager['itemspage']]];
- $r = Item::select(local_user(), ['item_id'], $condition, $params);
+ $r = Item::selectForUser(local_user(), ['item_id'], $condition, $params);
if (DBM::is_result($r)) {
$parents_arr = [];
dba::close($r);
$condition = ['uid' => local_user(), 'parent' => $parents_arr];
- $result = Item::select(local_user(), Item::DISPLAY_FIELDLIST, $condition);
+ $result = Item::selectForUser(local_user(), [], $condition);
if (DBM::is_result($result)) {
$items = conv_sort(dba::inArray($result), 'commented');
$o .= conversation($a, $items, 'notes', $update);
$fields = ['id', 'parent', 'verb', 'author-name', 'unseen', 'author-link', 'author-avatar', 'contact-avatar',
'network', 'created', 'object', 'parent-author-name', 'parent-author-link', 'parent-guid'];
$params = ['order' => ['created' => true]];
- $items = Item::select(local_user(), $fields, $condition, $params);
+ $items = Item::selectForUser(local_user(), $fields, $condition, $params);
if (DBM::is_result($items)) {
$items_unseen = dba::inArray($items);
if ($parent) {
$fields = ['uri', 'private', 'allow_cid', 'allow_gid', 'deny_cid', 'deny_gid'];
$condition = ['id' => $parent, 'parent' => $parent, 'uid' => $uid];
- $item = Item::selectFirst(local_user(), $fields, $condition);
+ $item = Item::selectFirst($fields, $condition);
if (DBM::is_result($item)) {
$parent_uri = $item['uri'];
}
$condition = ['uid' => $a->profile['profile_uid'], 'parent' => $parents_arr];
- $result = Item::select($a->profile['profile_uid'], Item::DISPLAY_FIELDLIST, $condition);
+ $result = Item::selectForUser($a->profile['profile_uid'], [], $condition);
$items = conv_sort(dba::inArray($result), 'created');
} else {
$items = [];
}
dba::close($terms);
- $items = Item::select(local_user(), Item::DISPLAY_FIELDLIST, ['id' => array_reverse($itemids)]);
+ $items = Item::selectForUser(local_user(), [], ['id' => array_reverse($itemids)]);
$r = dba::inArray($items);
} else {
logger("Start fulltext search for '".$search."'", LOGGER_DEBUG);
local_user(), $search];
$params = ['order' => ['id' => true],
'limit' => [$a->pager['start'], $a->pager['itemspage']]];
- $items = Item::select(local_user(), Item::DISPLAY_FIELDLIST, $condition, $params);
+ $items = Item::selectForUser(local_user(), [], $condition, $params);
$r = dba::inArray($items);
}
$fields = ['private', 'body', 'author-name', 'author-link', 'author-avatar',
'guid', 'created', 'plink', 'title'];
- $item = Item::selectFirst(local_user(), $fields, ['id' => $post_id]);
+ $item = Item::selectFirst($fields, ['id' => $post_id]);
if (!DBM::is_result($item) || $item['private'] == 1) {
killme();
$item_id = (($a->argc > 1) ? notags(trim($a->argv[1])) : 0);
$condition = ["`parent` = ? OR `parent-uri` = ? AND `parent` = `id`", $item_id, $item_id];
- $item = Item::selectFirst(local_user(), [], $condition);
+ $item = Item::selectFirst([], $condition);
if (empty($item_id) || !DBM::is_result($item)) {
logger('subthread: no item ' . $item_id);
logger('tagger: tag ' . $term . ' item ' . $item_id);
- $item = Item::selectFirst(local_user(), [], ['id' => $item_id]);
+ $item = Item::selectFirst([], ['id' => $item_id]);
if (!$item_id || !DBM::is_result($item)) {
logger('tagger: no item ' . $item_id);
$fields = ['id', 'parent', 'verb', 'author-name', 'unseen', 'author-link', 'author-avatar', 'contact-avatar',
'network', 'created', 'object', 'parent-author-name', 'parent-author-link', 'parent-guid'];
$params = ['order' => ['created' => true], 'limit' => [$start, $limit]];
- $items = Item::select(local_user(), $fields, $condition, $params);
+ $items = Item::selectForUser(local_user(), $fields, $condition, $params);
if (DBM::is_result($items)) {
$notifs = $this->formatNotifs(dba::inArray($items), $ident);
$fields = ['id', 'parent', 'verb', 'author-name', 'unseen', 'author-link', 'author-avatar', 'contact-avatar',
'network', 'created', 'object', 'parent-author-name', 'parent-author-link', 'parent-guid'];
$params = ['order' => ['created' => true], 'limit' => [$start, $limit]];
- $items = Item::select(local_user(), $fields, $condition, $params);
+ $items = Item::selectForUser(local_user(), $fields, $condition, $params);
if (DBM::is_result($items)) {
$notifs = $this->formatNotifs(dba::inArray($items), $ident);
$fields = ['id', 'parent', 'verb', 'author-name', 'unseen', 'author-link', 'author-avatar', 'contact-avatar',
'network', 'created', 'object', 'parent-author-name', 'parent-author-link', 'parent-guid'];
$params = ['order' => ['created' => true], 'limit' => [$start, $limit]];
- $items = Item::select(local_user(), $fields, $condition, $params);
+ $items = Item::selectForUser(local_user(), $fields, $condition, $params);
if (DBM::is_result($items)) {
$notifs = $this->formatNotifs(dba::inArray($items), $ident);
$author_id, ACTIVITY_POST, local_user()];
$params = ['order' => ['created' => true],
'limit' => [$a->pager['start'], $a->pager['itemspage']]];
- $r = Item::select(local_user(), Item::DISPLAY_FIELDLIST, $condition, $params);
+ $r = Item::selectForUser(local_user(), [], $condition, $params);
$items = dba::inArray($r);
'signed_text', 'signature', 'signer'];
/**
- * Retrieve a single record from the item table and returns it in an associative array
+ * Retrieve a single record from the item table for a given user and returns it in an associative array
*
* @brief Retrieve a single record from a table
* @param integer $uid User ID
* @return bool|array
* @see dba::select
*/
- public static function selectFirst($uid, array $fields = [], array $condition = [], $params = [])
+ public static function selectFirstForUser($uid, array $selected = [], array $condition = [], $params = [])
+ {
+ $params['uid'] = $uid;
+
+ if (empty($selected)) {
+ $selected = Item::DISPLAY_FIELDLIST;
+ }
+
+ return self::selectFirst($selected, $condition, $params);
+ }
+
+ /**
+ * @brief Select rows from the item table for a given user
+ *
+ * @param integer $uid User ID
+ * @param array $selected Array of selected fields, empty for all
+ * @param array $condition Array of fields for condition
+ * @param array $params Array of several parameters
+ *
+ * @return boolean|object
+ */
+ public static function selectForUser($uid, array $selected = [], array $condition = [], $params = [])
+ {
+ $params['uid'] = $uid;
+
+ if (empty($selected)) {
+ $selected = Item::DISPLAY_FIELDLIST;
+ }
+
+ return self::select($selected, $condition, $params);
+ }
+
+ /**
+ * Retrieve a single record from the item table and returns it in an associative array
+ *
+ * @brief Retrieve a single record from a table
+ * @param array $fields
+ * @param array $condition
+ * @param array $params
+ * @return bool|array
+ * @see dba::select
+ */
+ public static function selectFirst(array $fields = [], array $condition = [], $params = [])
{
$params['limit'] = 1;
- $result = self::select($uid, $fields, $condition, $params);
+
+ $result = self::select($fields, $condition, $params);
if (is_bool($result)) {
return $result;
/**
* @brief Select rows from the item table
*
- * @param integer $uid User ID
- * @param array $fields Array of selected fields, empty for all
+ * @param array $selected Array of selected fields, empty for all
* @param array $condition Array of fields for condition
* @param array $params Array of several parameters
*
* @return boolean|object
*/
- public static function select($uid, array $selected = [], array $condition = [], $params = [])
+ public static function select(array $selected = [], array $condition = [], $params = [])
{
+ $uid = 0;
+ $usermode = false;
+
+ if (isset($params['uid'])) {
+ $uid = $params['uid'];
+ $usermode = true;
+ }
+
$fields = self::fieldlist($selected);
$select_fields = self::constructSelectFields($fields, $selected);
$condition_string = self::addTablesToFields($condition_string, $fields);
- $condition_string = $condition_string . ' AND ' . self::condition(false);
+ if ($usermode) {
+ $condition_string = $condition_string . ' AND ' . self::condition(false);
+ }
$param_string = self::addTablesToFields(dba::buildParameter($params), $fields);
* @return bool|array
* @see dba::select
*/
- public static function selectFirstThread($uid, array $fields = [], array $condition = [], $params = [])
+ public static function selectFirstThreadForUser($uid, array $fields = [], array $condition = [], $params = [])
{
$params['limit'] = 1;
- $result = self::selectThread($uid, $fields, $condition, $params);
+ $result = self::selectThreadForUser($uid, $fields, $condition, $params);
if (is_bool($result)) {
return $result;
*
* @return boolean|object
*/
- public static function selectThread($uid, array $selected = [], array $condition = [], $params = [])
+ public static function selectThreadForUser($uid, array $selected = [], array $condition = [], $params = [])
{
+ if (empty($selected)) {
+ $selected = Item::DISPLAY_FIELDLIST;
+ }
+
$fields = self::fieldlist($selected);
$threadfields = ['thread' => ['iid', 'uid', 'contact-id', 'owner-id', 'author-id',
*/
private static function fieldlist($selected)
{
- /*
- These Fields are not added below. They are here to for bug search.
- */
-
$item_fields = ['author-id', 'owner-id', 'contact-id', 'uid', 'id', 'parent',
'uri', 'thr-parent', 'parent-uri', 'content-warning',
'commented', 'created', 'edited', 'received', 'verb', 'object-type', 'postopts', 'plink',
$ids[] = $item['id'];
}
- $condition = ['id' => $ids];
- $fields = ['author-id', 'uid', 'id', 'parent', 'uri', 'thr-parent',
- 'parent-uri', 'created', 'edited', 'verb', 'object-type',
- 'guid', 'private', 'title', 'body', 'location', 'coord', 'app',
- 'attach', 'object', 'allow_cid', 'allow_gid', 'deny_cid', 'deny_gid',
- 'extid', 'target', 'tag', 'bookmark', 'deleted',
- 'author-link', 'owner-link', 'signed_text', 'signature', 'signer'];
- $ret = Item::select($owner_id, $fields, $condition);
- $items = dba::inArray($ret);
+ if (!empty($ids)) {
+ $condition = ['id' => $ids];
+ $fields = ['author-id', 'uid', 'id', 'parent', 'uri', 'thr-parent',
+ 'parent-uri', 'created', 'edited', 'verb', 'object-type',
+ 'guid', 'private', 'title', 'body', 'location', 'coord', 'app',
+ 'attach', 'object', 'allow_cid', 'allow_gid', 'deny_cid', 'deny_gid',
+ 'extid', 'target', 'tag', 'bookmark', 'deleted',
+ 'author-link', 'owner-link', 'signed_text', 'signature', 'signer'];
+ $ret = Item::select($fields, $condition);
+ $items = dba::inArray($ret);
+ } else {
+ $items = [];
+ }
/*
* Will check further below if this actually returned results.
'attach', 'object', 'allow_cid', 'allow_gid', 'deny_cid', 'deny_gid',
'extid', 'target', 'tag', 'bookmark', 'deleted',
'author-link', 'owner-link', 'signed_text', 'signature', 'signer'];
- $ret = Item::select(0, $fields, $condition);
+ $ret = Item::select($fields, $condition);
$items = dba::inArray($ret);
if (!DBM::is_result($items)) {
killme();
if (Config::get("system", "relay_directly", false)) {
// We distribute our stuff based on the parent to ensure that the thread will be complete
- $parent = Item::selectFirst(0, ['parent'], ['id' => $item_id]);
+ $parent = Item::selectFirst(['parent'], ['id' => $item_id]);
if (!DBM::is_result($parent)) {
return;
}
*/
private static function messageExists($uid, $guid)
{
- $item = Item::selectFirst($uid, ['id'], ['uid' => $uid, 'guid' => $guid]);
+ $item = Item::selectFirst(['id'], ['uid' => $uid, 'guid' => $guid]);
if (DBM::is_result($item)) {
logger("message ".$guid." already exists for user ".$uid);
return $item["id"];
'author-name', 'author-link', 'author-avatar',
'owner-name', 'owner-link', 'owner-avatar'];
$condition = ['uid' => $uid, 'guid' => $guid];
- $item = Item::selectFirst($uid, $fields, $condition);
+ $item = Item::selectFirst($fields, $condition);
if (!DBM::is_result($item)) {
$result = self::storeByGuid($guid, $contact["url"], $uid);
if ($result) {
logger("Fetched missing item ".$guid." - result: ".$result, LOGGER_DEBUG);
- $item = Item::selectFirst($uid, $fields, $condition);
+ $item = Item::selectFirst($fields, $condition);
}
}
*/
private static function getUriFromGuid($author, $guid, $onlyfound = false)
{
- $item = Item::selectFirst(0, ['uri'], ['guid' => $guid]);
+ $item = Item::selectFirst(['uri'], ['guid' => $guid]);
if (DBM::is_result($item)) {
return $item["uri"];
} elseif (!$onlyfound) {
*/
private static function getGuidFromUri($uri, $uid)
{
- $item = Item::selectFirst($uid, ['guid'], ['uri' => $uri, 'uid' => $uid]);
+ $item = Item::selectFirst(['guid'], ['uri' => $uri, 'uid' => $uid]);
if (DBM::is_result($item)) {
return $item["guid"];
} else {
*/
private static function importerForGuid($guid)
{
- $item = Item::selectFirst(0, ['uid'], ['origin' => true, 'guid' => $guid]);
+ $item = Item::selectFirst(['uid'], ['origin' => true, 'guid' => $guid]);
if (DBM::is_result($item)) {
logger("Found user ".$item['uid']." as owner of item ".$guid, LOGGER_DEBUG);
$contact = dba::selectFirst('contact', [], ['self' => true, 'uid' => $item['uid']]);
// like on comments have the comment as parent. So we need to fetch the toplevel parent
if ($parent_item["id"] != $parent_item["parent"]) {
- $toplevel = Item::selectFirst($importer["uid"], ['origin'], ['id' => $parent_item["parent"]]);
+ $toplevel = Item::selectFirst(['origin'], ['id' => $parent_item["parent"]]);
$origin = $toplevel["origin"];
} else {
$origin = $parent_item["origin"];
return false;
}
- $item = Item::selectFirst(0, ['id'], ['guid' => $parent_guid, 'origin' => true, 'private' => false]);
+ $item = Item::selectFirst(['id'], ['guid' => $parent_guid, 'origin' => true, 'private' => false]);
if (!DBM::is_result($item)) {
logger('Item not found, no origin or private: '.$parent_guid);
return false;
}
// Send all existing comments and likes to the requesting server
- $comments = Item::select(0, ['id', 'verb', 'self'], ['parent' => $item['id']]);
+ $comments = Item::select(['id', 'verb', 'self'], ['parent' => $item['id']]);
while ($comment = dba::fetch($comments)) {
if ($comment['id'] == $comment['parent']) {
continue;
$fields = ['body', 'tag', 'app', 'created', 'object-type', 'uri', 'guid',
'author-name', 'author-link', 'author-avatar'];
$condition = ['guid' => $guid, 'visible' => true, 'deleted' => false, 'private' => false];
- $item = Item::selectFirst(0, $fields, $condition);
+ $item = Item::selectFirst($fields, $condition);
if (DBM::is_result($item)) {
logger("reshared message ".$guid." already exists on system.");
$fields = ['body', 'tag', 'app', 'created', 'object-type', 'uri', 'guid',
'author-name', 'author-link', 'author-avatar'];
$condition = ['guid' => $guid, 'visible' => true, 'deleted' => false, 'private' => false];
- $item = Item::selectFirst(0, $fields, $condition);
+ $item = Item::selectFirst($fields, $condition);
if (DBM::is_result($item)) {
// If it is a reshared post from another network then reformat to avoid display problems with two share elements
} else {
$condition = ["`guid` = ? AND `uid` = ? AND NOT `file` LIKE '%%[%%' AND NOT `deleted`", $target_guid, $importer['uid']];
}
- $r = Item::select($importer['uid'], $fields, $condition);
+ $r = Item::select($fields, $condition);
if (!DBM::is_result($r)) {
logger("Target guid ".$target_guid." was not found on this system for user ".$importer['uid'].".");
return false;
while ($item = dba::fetch($r)) {
// Fetch the parent item
- $parent = Item::selectFirst(0, ['author-link'], ['id' => $item["parent"]]);
+ $parent = Item::selectFirst(['author-link'], ['id' => $item["parent"]]);
// Only delete it if the parent author really fits
if (!link_compare($parent["author-link"], $contact["url"]) && !link_compare($item["author-link"], $contact["url"])) {
if (($guid != "") && $complete) {
$condition = ['guid' => $guid, 'network' => [NETWORK_DFRN, NETWORK_DIASPORA]];
- $item = Item::selectFirst(0, ['contact-id'], $condition);
+ $item = Item::selectFirst(['contact-id'], $condition);
if (DBM::is_result($item)) {
$ret= [];
$ret["root_handle"] = self::handleFromContact($item["contact-id"]);
*/
private static function constructLike($item, $owner)
{
- $parent = Item::selectFirst(0, ['guid', 'uri', 'parent-uri'], ['uri' => $item["thr-parent"]]);
+ $parent = Item::selectFirst(['guid', 'uri', 'parent-uri'], ['uri' => $item["thr-parent"]]);
if (!DBM::is_result($parent)) {
return false;
}
*/
private static function constructAttend($item, $owner)
{
- $parent = Item::selectFirst(0, ['guid', 'uri', 'parent-uri'], ['uri' => $item["thr-parent"]]);
+ $parent = Item::selectFirst(['guid', 'uri', 'parent-uri'], ['uri' => $item["thr-parent"]]);
if (!DBM::is_result($parent)) {
return false;
}
return $result;
}
- $parent = Item::selectFirst(0, ['guid'], ['id' => $item["parent"], 'parent' => $item["parent"]]);
+ $parent = Item::selectFirst(['guid'], ['id' => $item["parent"], 'parent' => $item["parent"]]);
if (!DBM::is_result($parent)) {
return false;
}
$contact["uprvkey"] = $r[0]['prvkey'];
- $item = Item::selectFirst(0, [], ['id' => $post_id]);
+ $item = Item::selectFirst([], ['id' => $post_id]);
if (!DBM::is_result($item)) {
return false;
}