You are here

public function ProfileInterface::equalToProfile in Profile 8

Checks whether the other profile is equal to the current profile.

By default, profiles are compared using configurable fields only, which means that two profiles can be considered equal even if they are of different types, or belong to different users. Pass "type", and/or "uid" as $field_names to avoid this behavior.

Parameters

\Drupal\profile\Entity\ProfileInterface $profile: The other profile.

string[] $field_names: The names of fields to compare. If empty, all configurable fields will be compared.

Return value

bool TRUE if the two profiles are equal, FALSE otherwise.

1 method overrides ProfileInterface::equalToProfile()
Profile::equalToProfile in src/Entity/Profile.php
Checks whether the other profile is equal to the current profile.

File

src/Entity/ProfileInterface.php, line 156

Class

ProfileInterface
Provides an interface for profiles.

Namespace

Drupal\profile\Entity

Code

public function equalToProfile(ProfileInterface $profile, array $field_names = []);