You are here

protected static function ProfileFieldCopy::getBillingProfile in Commerce Shipping 8.2

Gets the billing profile from the inline form.

Parameters

array $inline_form: The inline form.

Return value

\Drupal\profile\Entity\ProfileInterface The profile.

3 calls to ProfileFieldCopy::getBillingProfile()
ProfileFieldCopy::alterForm in src/ProfileFieldCopy.php
Alters the inline form.
ProfileFieldCopy::submitForm in src/ProfileFieldCopy.php
Submits the inline form.
ProfileFieldCopy::validateForm in src/ProfileFieldCopy.php
Validates the inline form.

File

src/ProfileFieldCopy.php, line 244

Class

ProfileFieldCopy
Default implementation of profile field copying ("Billing same as shipping").

Namespace

Drupal\commerce_shipping

Code

protected static function getBillingProfile(array &$inline_form) {

  /** @var \Drupal\commerce\Plugin\Commerce\InlineForm\EntityInlineFormInterface $plugin */
  $plugin = $inline_form['#inline_form'];
  $profile = $plugin
    ->getEntity();
  assert($profile instanceof ProfileInterface);
  return $profile;
}