return $profile;
}
+ /**
+ * @brief Returns the profile based on a ID
+ *
+ * @param int $uid The User ID
+ * @param int $id The id of the profile (optional)
+ * @param array $fields The fields to retrieve
+ *
+ * @return array Array of profile data
+ * @throws \Exception
+ */
+ public static function select(int $uid, int $id = null, array $fields = [])
+ {
+ if (empty($id)) {
+ return DBA::selectToArray('profile', $fields, ['uid' => $uid]);
+ } else {
+ return DBA::selectFirst('profile', $fields, ['uid' => $uid, 'id' => $id]);
+ }
+ }
+
/**
* @brief Returns a formatted location string from the given profile array
*
'pending' => false,
'hidden' => false,
'archive' => false,
- 'network' => [Protocol::DFRN, Protocol::ACTIVITYPUB, Protocol::OSTATUS, Protocol::DIASPORA],
+ 'network' => Protocol::FEDERATED,
]);
}
}
public static function getAdvanced(App $a)
{
- $uid = $a->profile['uid'];
+ $uid = intval($a->profile['uid']);
if ($a->profile['name']) {
$tpl = Renderer::getMarkupTemplate('profile_advanced.tpl');