<?php declare(strict_types=1);


namespace Neusta\IntexCustomer\Controller;


use Neusta\IntexClient\Connection\Model\CustomerConnection;

class CustomerDataController
{
    /**
     * @var CustomerConnection
     */
    private $connection;

    public function __construct(\Neusta\IntexClient\Connection\Factory $connectionFactory, \Neusta\IntexCustomer\Handler\DataHandler $dataHandler)
    {
        $this->connection = $connectionFactory->create('customer');
        $this->customerDataHandler = $dataHandler;
    }

    public function getCustomerData(): void
    {
        $customerData = $this->connection->loadCustomerData();

        $this->customerDataHandler->saveCustomerData($customerData);
    }
}
