mirror of
https://github.com/friendica/friendica
synced 2025-04-19 10:30:10 +00:00
Move ProfileFieldRepository::migrateFromLegacyProfile() & delete old repository
This commit is contained in:
parent
f403851946
commit
838cdac5d1
9 changed files with 93 additions and 166 deletions
|
@ -45,7 +45,7 @@ class Show extends BaseApi
|
|||
|
||||
$profile = Profile::getByUID($uid);
|
||||
|
||||
$profileFields = DI::profileFieldNew()->selectPublicFieldsByUserId($uid);
|
||||
$profileFields = DI::profileField()->selectPublicFieldsByUserId($uid);
|
||||
|
||||
$profile = self::formatProfile($profile, $profileFields);
|
||||
|
||||
|
|
|
@ -213,9 +213,9 @@ class Profile extends BaseProfile
|
|||
$contact_id = $view_as_contact_id ?: $remote_contact_id ?: 0;
|
||||
|
||||
if ($is_owner && $contact_id === 0) {
|
||||
$profile_fields = DI::profileFieldNew()->selectByUserId($profile['uid']);
|
||||
$profile_fields = DI::profileField()->selectByUserId($profile['uid']);
|
||||
} else {
|
||||
$profile_fields = DI::profileFieldNew()->selectByContactId($contact_id, $profile['uid']);
|
||||
$profile_fields = DI::profileField()->selectByContactId($contact_id, $profile['uid']);
|
||||
}
|
||||
|
||||
foreach ($profile_fields as $profile_field) {
|
||||
|
|
|
@ -107,7 +107,7 @@ class Index extends BaseSettings
|
|||
$_REQUEST['profile_field_order']
|
||||
);
|
||||
|
||||
DI::profileFieldNew()->saveCollectionForUser(local_user(), $profileFieldsNew);
|
||||
DI::profileField()->saveCollectionForUser(local_user(), $profileFieldsNew);
|
||||
|
||||
$result = Profile::update(
|
||||
[
|
||||
|
@ -157,7 +157,7 @@ class Index extends BaseSettings
|
|||
|
||||
$custom_fields = [];
|
||||
|
||||
$profileFields = DI::profileFieldNew()->selectByUserId(local_user());
|
||||
$profileFields = DI::profileField()->selectByUserId(local_user());
|
||||
foreach ($profileFields as $profileField) {
|
||||
/** @var ProfileField $profileField */
|
||||
$defaultPermissions = $profileField->permissionSet->withAllowedContacts(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue