<?php

use FiloBlu\Refilo\Remote\Entity\Category;
use FiloBlu\Refilo\Remote\Entity\MagentoToRefiloCategoryAdapter;;
use Magento\Catalog\Api\CategoryRepositoryInterface;
use Magento\Framework\App\Bootstrap;
use Magento\Framework\App\ObjectManager;
use Magento\Framework\App\State;

require __DIR__ . '/../../../../../app/bootstrap.php';
$params = $_SERVER;
$bootstrap = Bootstrap::create(BP, $params);
$obj = $bootstrap->getObjectManager();
$state = $obj->get(State::class);
$state->setAreaCode('adminhtml');
$objectManager = ObjectManager::getInstance();



/** @var  $categoryRepository */
$categoryRepository = $objectManager->get(CategoryRepositoryInterface::class);
$category = $categoryRepository->get(60);

/** @var MagentoToRefiloCategoryAdapter $adapter */
$adapter = $objectManager->create(MagentoToRefiloCategoryAdapter::class);

$refiloCategory = new Category();

$result = $adapter->adapt($category, $refiloCategory);

echo "Done";
