6
6
namespace Magento \Sales \Model ;
7
7
8
8
use Magento \Config \Model \Config \Source \Nooptreq ;
9
- use Magento \Customer \Api \CustomerRepositoryInterface ;
10
9
use Magento \Directory \Model \Currency ;
11
10
use Magento \Framework \Api \AttributeValueFactory ;
12
11
use Magento \Framework \Api \SearchCriteriaBuilder ;
52
51
* @method bool hasCustomerNoteNotify()
53
52
* @method bool hasForcedCanCreditmemo()
54
53
* @method bool getIsInProcess()
54
+ * @method \Magento\Customer\Model\Customer|null getCustomer()
55
55
* @method \Magento\Sales\Model\Order setSendEmail(bool $value)
56
56
* @SuppressWarnings(PHPMD.ExcessivePublicCount)
57
57
* @SuppressWarnings(PHPMD.TooManyFields)
@@ -307,11 +307,6 @@ class Order extends AbstractModel implements EntityInterface, OrderInterface
307
307
*/
308
308
private $ scopeConfig ;
309
309
310
- /**
311
- * @var CustomerRepositoryInterface
312
- */
313
- private $ _customerRepositoryInterface ;
314
-
315
310
/**
316
311
* @param \Magento\Framework\Model\Context $context
317
312
* @param \Magento\Framework\Registry $registry
@@ -345,7 +340,6 @@ class Order extends AbstractModel implements EntityInterface, OrderInterface
345
340
* @param OrderItemRepositoryInterface $itemRepository
346
341
* @param SearchCriteriaBuilder $searchCriteriaBuilder
347
342
* @param ScopeConfigInterface $scopeConfig
348
- * @param CustomerRepositoryInterface $customerRepositoryInterface
349
343
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
350
344
*/
351
345
public function __construct (
@@ -372,7 +366,6 @@ public function __construct(
372
366
\Magento \Sales \Model \ResourceModel \Order \Shipment \Track \CollectionFactory $ trackCollectionFactory ,
373
367
\Magento \Sales \Model \ResourceModel \Order \CollectionFactory $ salesOrderCollectionFactory ,
374
368
PriceCurrencyInterface $ priceCurrency ,
375
- CustomerRepositoryInterface $ customerRepositoryInterface ,
376
369
\Magento \Catalog \Model \ResourceModel \Product \CollectionFactory $ productListFactory ,
377
370
\Magento \Framework \Model \ResourceModel \AbstractResource $ resource = null ,
378
371
\Magento \Framework \Data \Collection \AbstractDb $ resourceCollection = null ,
@@ -410,7 +403,6 @@ public function __construct(
410
403
$ this ->searchCriteriaBuilder = $ searchCriteriaBuilder ?: ObjectManager::getInstance ()
411
404
->get (SearchCriteriaBuilder::class);
412
405
$ this ->scopeConfig = $ scopeConfig ?: ObjectManager::getInstance ()->get (ScopeConfigInterface::class);
413
- $ this ->_customerRepositoryInterface = $ customerRepositoryInterface ;
414
406
415
407
parent ::__construct (
416
408
$ context ,
@@ -570,19 +562,6 @@ public function getStore()
570
562
return $ this ->_storeManager ->getStore ();
571
563
}
572
564
573
- /**
574
- * Returns Customer
575
- *
576
- * @return \Magento\Customer\Api\Data\CustomerInterface
577
- * @throws LocalizedException
578
- * @throws \Magento\Framework\Exception\NoSuchEntityException
579
- */
580
- public function getCustomer ()
581
- {
582
- $ customerId = $ this ->getData (OrderInterface::CUSTOMER_ID );
583
- return $ this ->_customerRepositoryInterface ->getById ($ customerId );
584
- }
585
-
586
565
/**
587
566
* Retrieve order cancel availability
588
567
*
0 commit comments