acquia_commercemanager-8.x-1.122/modules/acm/src/User/CommerceAccountProxy.php

modules/acm/src/User/CommerceAccountProxy.php
<?php

namespace Drupal\acm\User;

/**
 * A proxied implementation of AccountInterface for normal drupal user accounts.
 */
class CommerceAccountProxy extends CommerceAccountProxyBase {

  /**
   * {@inheritdoc}
   */
  public function loadCommerceUser() {
    $account = NULL;

    try {
      $user = \Drupal::currentUser();
      if ($email = $user->getEmail()) {
        $account = $this->apiWrapper->getCustomer($email);
      }
    }
    catch (\Exception $e) {
    }

    return $account;
  }

}

Главная | Обратная связь

drupal hosting | друпал хостинг | it patrol .inc