You are here

interface ProfileStorageInterface in Profile 8

Defines an interface for profile entity storage.

Hierarchy

Expanded class hierarchy of ProfileStorageInterface

All classes that implement ProfileStorageInterface

File

src/ProfileStorageInterface.php, line 11

Namespace

Drupal\profile
View source
interface ProfileStorageInterface extends EntityStorageInterface {

  /**
   * Loads the given user's profiles.
   *
   * @param \Drupal\Core\Session\AccountInterface $account
   *   The user.
   * @param string $profile_type_id
   *   The profile type ID.
   * @param bool $published
   *   Whether to load published or unpublished profiles. Defaults to published.
   *
   * @return \Drupal\profile\Entity\ProfileInterface[]
   *   The profiles, ordered by publishing status and ID, descending.
   */
  public function loadMultipleByUser(AccountInterface $account, $profile_type_id, $published = TRUE);

  /**
   * 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.
   *
   * @param \Drupal\Core\Session\AccountInterface $account
   *   The user.
   * @param string $profile_type_id
   *   The profile type ID.
   *
   * @return \Drupal\profile\Entity\ProfileInterface|null
   *   The profile. NULL if no matching entity was found.
   */
  public function loadByUser(AccountInterface $account, $profile_type_id);

  /**
   * Loads the given user's default profile.
   *
   * @param \Drupal\Core\Session\AccountInterface $account
   *   The user.
   * @param string $profile_type_id
   *   The profile type ID.
   *
   * @return \Drupal\profile\Entity\ProfileInterface|null
   *   The profile. NULL if no matching entity was found.
   *
   * @deprecated in Profile 1.0. Use loadByUser() instead.
   */
  public function loadDefaultByUser(AccountInterface $account, $profile_type_id);

}

Members

Namesort descending Modifiers Type Description Overrides
EntityStorageInterface::create public function Constructs a new entity object, without permanently saving it. 1
EntityStorageInterface::delete public function Deletes permanently saved entities. 1
EntityStorageInterface::deleteRevision public function Delete a specific entity revision. 4
EntityStorageInterface::FIELD_LOAD_CURRENT constant Load the most recent version of an entity's field data.
EntityStorageInterface::FIELD_LOAD_REVISION constant Load the version of an entity's field data specified in the entity.
EntityStorageInterface::getAggregateQuery public function Gets an aggregated query instance. 1
EntityStorageInterface::getEntityType public function Gets the entity type definition. 1
EntityStorageInterface::getEntityTypeId public function Gets the entity type ID. 1
EntityStorageInterface::getQuery public function Gets an entity query instance. 1
EntityStorageInterface::hasData public function Determines if the storage contains any data. 1
EntityStorageInterface::load public function Loads one entity. 1
EntityStorageInterface::loadByProperties public function Load entities by their property values. 1
EntityStorageInterface::loadMultiple public function Loads one or more entities. 1
EntityStorageInterface::loadRevision public function Load a specific entity revision. 4
EntityStorageInterface::loadUnchanged public function Loads an unchanged entity from the database. 1
EntityStorageInterface::resetCache public function Resets the internal, static entity cache. 1
EntityStorageInterface::restore public function Restores a previously saved entity. 1
EntityStorageInterface::save public function Saves the entity permanently. 1
ProfileStorageInterface::loadByUser public function Loads the given user's profile. 1
ProfileStorageInterface::loadDefaultByUser Deprecated public function Loads the given user's default profile. 1
ProfileStorageInterface::loadMultipleByUser public function Loads the given user's profiles. 1