I am trying to get a magento customer increment ID. I’m thinking I have to use the resource-model class just not sure what the best way to access it is or how to get it.
public function __construct(
MagentoCustomerApiCustomerRepositoryInterface $customerRepositoryInterface,
MagentoCustomerModelResourceModelCustomer $resourceModel,
)
{
parent::__construct();
$this->customerRepo = $customerRepositoryInterface;
$this->customerResource = $resourceModel;
}
protected function execute(
InputInterface $input,
OutputInterface $output
)
{
$email = 'email@email.com'
$data = $this->customerRepo->get($email);
$cid = $data->getId(); //checking exists
$rsrd= $this->customerResource->loadByEmail($data, $email);
$incrementid = $data->getAttribute('increment_id');
$output->writeln( 'email: ' . $email . ' customer id: ' . $incrementid );
}
}