Skip to content
This repository has been archived by the owner on Dec 19, 2019. It is now read-only.

Commit

Permalink
Correct signature of the $customerModel
Browse files Browse the repository at this point in the history
New import was added to change the signature of the Customer's Model.
Previously it was signed as a ResourseModel and IDE reported that required parameters of save() method were missed.
Imports were reordered to pass the code style and code standards compliance tests.

Signed-off-by: Tomash Khamlai <[email protected]>
  • Loading branch information
TomashKhamlai committed Oct 9, 2019
1 parent 68c48d5 commit 35b37c0
Showing 1 changed file with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,25 @@
namespace Magento\Customer\Model\ResourceModel;

use Magento\Customer\Api\CustomerMetadataInterface;
use Magento\Customer\Api\CustomerRepositoryInterface;
use Magento\Customer\Api\Data\CustomerInterface;
use Magento\Customer\Api\Data\CustomerSearchResultsInterfaceFactory;
use Magento\Framework\Api\ExtensibleDataObjectConverter;
use Magento\Framework\Api\ExtensionAttribute\JoinProcessorInterface;
use Magento\Customer\Model\Customer as CustomerModel;
use Magento\Customer\Model\Customer\NotificationStorage;
use Magento\Customer\Model\CustomerFactory;
use Magento\Customer\Model\CustomerRegistry;
use Magento\Customer\Model\Data\CustomerSecureFactory;
use Magento\Customer\Model\Customer\NotificationStorage;
use Magento\Customer\Model\Delegation\Data\NewOperation;
use Magento\Customer\Api\CustomerRepositoryInterface;
use Magento\Customer\Model\Delegation\Storage as DelegatedStorage;
use Magento\Framework\Api\DataObjectHelper;
use Magento\Framework\Api\ExtensibleDataObjectConverter;
use Magento\Framework\Api\ExtensionAttribute\JoinProcessorInterface;
use Magento\Framework\Api\ImageProcessorInterface;
use Magento\Framework\Api\Search\FilterGroup;
use Magento\Framework\Api\SearchCriteria\CollectionProcessorInterface;
use Magento\Framework\Api\SearchCriteriaInterface;
use Magento\Framework\Api\Search\FilterGroup;
use Magento\Framework\Event\ManagerInterface;
use Magento\Customer\Model\Delegation\Storage as DelegatedStorage;
use Magento\Framework\App\ObjectManager;
use Magento\Framework\Event\ManagerInterface;
use Magento\Store\Model\StoreManagerInterface;

/**
Expand Down Expand Up @@ -203,7 +204,7 @@ public function save(CustomerInterface $customer, $passwordHash = null)
$customer->setAddresses([]);
$customerData = $this->extensibleDataObjectConverter->toNestedArray($customer, [], CustomerInterface::class);
$customer->setAddresses($origAddresses);
/** @var Customer $customerModel */
/** @var CustomerModel $customerModel */
$customerModel = $this->customerFactory->create(['data' => $customerData]);
//Model's actual ID field maybe different than "id" so "id" field from $customerData may be ignored.
$customerModel->setId($customer->getId());
Expand Down

0 comments on commit 35b37c0

Please sign in to comment.