public function ProfileStorageInterface::loadByUser in Profile 8
Loads the given user's profile.
Takes the default profile, if found. Otherwise falls back to the newest published profile.
Primarily used for profile types which only allow a single profile per user.
Parameters
\Drupal\Core\Session\AccountInterface $account: The user.
string $profile_type_id: The profile type ID.
Return value
\Drupal\profile\Entity\ProfileInterface|null The profile. NULL if no matching entity was found.
1 method overrides ProfileStorageInterface::loadByUser()
- ProfileStorage::loadByUser in src/
ProfileStorage.php - Loads the given user's profile.
File
- src/
ProfileStorageInterface.php, line 45
Class
- ProfileStorageInterface
- Defines an interface for profile entity storage.
Namespace
Drupal\profileCode
public function loadByUser(AccountInterface $account, $profile_type_id);