diff --git a/profile.module b/profile.module index 72f6d1e..a65ce80 100644 --- a/profile.module +++ b/profile.module @@ -31,12 +31,12 @@ const PROFILE_ACTIVE = 1; /** * Denotes that the profile is not default. */ -const PROFILE_NOT_PRIMARY = 0; +const PROFILE_NOT_DEFAULT = 0; /** * Denotes that the profile is default. */ -const PROFILE_PRIMARY = 1; +const PROFILE_DEFAULT = 1; /** * Implements hook_help(). diff --git a/src/Entity/Profile.php b/src/Entity/Profile.php index dbc09b0..63e5d13 100644 --- a/src/Entity/Profile.php +++ b/src/Entity/Profile.php @@ -110,10 +110,9 @@ class Profile extends ContentEntityBase implements ProfileInterface { ->setRevisionable(TRUE) ->setDefaultValue(FALSE); - $fields['primary'] = BaseFieldDefinition::create('boolean') - ->setLabel(t('Primary')) - ->setDescription(t('A boolean indicating whether the profile is the primary one.')) - ->setRevisionable(TRUE) + $fields['is_default'] = BaseFieldDefinition::create('boolean') + ->setLabel(t('Default')) + ->setDescription(t('A boolean indicating whether the profile is the default one.')) ->setDefaultValue(FALSE); $fields['created'] = BaseFieldDefinition::create('created') @@ -269,15 +268,15 @@ class Profile extends ContentEntityBase implements ProfileInterface { /** * {@inheritdoc} */ - public function isPrimary() { - return (bool) $this->get('primary')->value; + public function isDefault() { + return (bool) $this->get('is_default')->value; } /** * {@inheritdoc} */ - public function setPrimary($primary) { - $this->set('primary', $primary ? PROFILE_PRIMARY : PROFILE_NOT_PRIMARY); + public function setDefault($is_default) { + $this->set('is_default', $is_default ? PROFILE_DEFAULT : PROFILE_NOT_DEFAULT); return $this; } diff --git a/src/Entity/ProfileInterface.php b/src/Entity/ProfileInterface.php index 67930eb..8afefae 100644 --- a/src/Entity/ProfileInterface.php +++ b/src/Entity/ProfileInterface.php @@ -111,21 +111,21 @@ interface ProfileInterface extends ContentEntityInterface, EntityChangedInterfac public function setActive($active); /** - * Returns the primary status indicator. + * Returns the default status indicator. * * @return bool - * TRUE if the profile is the primary for its type. + * TRUE if the profile is the default for its type. */ - public function isPrimary(); + public function isDefault(); /** - * Sets the primary status of a profile. + * Sets the default status of a profile. * - * @param bool $primary - * TRUE to set this profile to primary, FALSE to set it to not be primary. + * @param bool $is_default + * TRUE to set this profile to default, FALSE to set it to not be default. * * @return $this */ - public function setPrimary($primary); + public function setDefault($is_default); }