You are here

protected function CustomerProfile::isProfileIncomplete in Commerce Core 8.2

Checks whether the given profile is incomplete.

A profile is incomplete if it has an empty required field.

Parameters

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

Return value

bool TRUE if the given profile is incomplete, FALSE otherwise.

1 call to CustomerProfile::isProfileIncomplete()
CustomerProfile::shouldRender in modules/order/src/Plugin/Commerce/InlineForm/CustomerProfile.php
Determines whether the current profile should be shown rendered.

File

modules/order/src/Plugin/Commerce/InlineForm/CustomerProfile.php, line 600

Class

CustomerProfile
Provides an inline form for managing a customer profile.

Namespace

Drupal\commerce_order\Plugin\Commerce\InlineForm

Code

protected function isProfileIncomplete(ProfileInterface $profile) {
  $violations = $profile
    ->validate();
  return count($violations) > 0;
}