public function ProfileController::setDefault in Profile 8
Mark profile as default.
Parameters
\Drupal\profile\Entity\ProfileInterface $profile: The profile.
Return value
\Symfony\Component\HttpFoundation\RedirectResponse A redirect back to the profile listing.
1 string reference to 'ProfileController::setDefault'
File
- src/
Controller/ ProfileController.php, line 20
Class
Namespace
Drupal\profile\ControllerCode
public function setDefault(ProfileInterface $profile) {
$profile
->setDefault(TRUE);
$profile
->save();
$this
->messenger()
->addMessage($this
->t('The %label profile has been marked as default.', [
'%label' => $profile
->label(),
]));
return new RedirectResponse($profile
->toUrl('collection')
->toString());
}