You are here

protected function Profile::getConfigurableFieldNames in Profile 8

Gets the names of all configurable fields on the given profile.

Parameters

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

Return value

string[] The field names.

2 calls to Profile::getConfigurableFieldNames()
Profile::equalToProfile in src/Entity/Profile.php
Checks whether the other profile is equal to the current profile.
Profile::populateFromProfile in src/Entity/Profile.php
Populates the profile with field values from the other profile.

File

src/Entity/Profile.php, line 241

Class

Profile
Defines the profile entity class.

Namespace

Drupal\profile\Entity

Code

protected function getConfigurableFieldNames(ProfileInterface $profile) {
  $field_names = [];
  foreach ($profile
    ->getFieldDefinitions() as $field_name => $definition) {
    if (!$definition instanceof BaseFieldDefinition) {
      $field_names[] = $field_name;
    }
  }
  return $field_names;
}