<?php

use FiloBlu\Refilo\Remote\Entity\Provider\CategoriesProductProvider;
use FiloBlu\Refilo\Remote\Entity\Provider\CategoryProvider;
use FiloBlu\Refilo\Remote\Entity\Provider\CategoryUrlProvider;
use FiloBlu\Refilo\Remote\Entity\Provider\DisabledProductProvider;
use FiloBlu\Refilo\Remote\Entity\Provider\DisabledProductUrlProvider;
use FiloBlu\Refilo\Remote\Entity\Provider\EntityUrlProvider;
use FiloBlu\Refilo\Remote\Entity\Provider\HomePageUrlProvider;
use FiloBlu\Refilo\Remote\Entity\Provider\MasterdataUrlProvider;
use FiloBlu\Refilo\Remote\Entity\Provider\PageUrlProvider;
use FiloBlu\Refilo\Remote\Entity\Provider\PriceProvider;
use FiloBlu\Refilo\Remote\Entity\Provider\ProductAttributeProvider;
use FiloBlu\Refilo\Remote\Entity\Provider\ProductProvider;
use FiloBlu\Refilo\Remote\Entity\Provider\RelatedProvider;
use FiloBlu\Refilo\Remote\Entity\Provider\StockProvider;
use FiloBlu\Refilo\Remote\Entity\Provider\VisibleProductProvider;
use FiloBlu\RefiloStaging\Remote\Entity\Provider\CmsBlockProvider;
use FiloBlu\RefiloStaging\Remote\Entity\Provider\CmsPageProvider;
use Magento\Framework\App\Bootstrap;
use Magento\Framework\App\ObjectManager;
use Magento\Framework\App\State;
use Magento\Store\Model\StoreManagerInterface;

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

/** @var StoreManagerInterface $storeManager */
$storeManager = $objectManager->get(StoreManagerInterface::class);

///** @var \FiloBlu\Refilo\Remote\Entity\Provider\RatingProvider $ratingProvider */
//$ratingProvider = $objectManager->get(\FiloBlu\Refilo\Remote\Entity\Provider\RatingProvider::class);
//foreach ($ratingProvider->toGenerator() as $key => $value) {
//    echo $key . "\t" . print_r($value, true) . "\n";
//}
//
///** @var \FiloBlu\Refilo\Remote\Entity\Provider\CategoryPermissionsProvider $categoryPermissionProvider */
//$categoryPermissionProvider = $objectManager->get(\FiloBlu\Refilo\Remote\Entity\Provider\CategoryPermissionsProvider::class);
//foreach ($categoryPermissionProvider->toGenerator() as $key => $value) {
//    echo $key . "\t" . count($value->getPermissions()) . "\n";
//}
//
///** @var CategoriesProductProvider $categoryProductProvider */
//$categoryProductProvider = $objectManager->get(CategoriesProductProvider::class);
//foreach ($categoryProductProvider->toGenerator() as $key => $data) {
//    echo ".";
//}
//
///** @var CategoryProvider $categoryProvider */
//$categoryProvider = $objectManager->get(CategoryProvider::class);
//$items = [];
//foreach ($categoryProvider->toGenerator($items) as $key => $data) {
//    echo ".";
//}
//
///** @var CategoryUrlProvider $categoryUrlProvider */
//$categoryUrlProvider = $objectManager->get(CategoryUrlProvider::class);
//foreach ($categoryUrlProvider->toGenerator() as $key => $data) {
//    echo ".";
//}
//
///** @var DisabledProductProvider $disabledProductProvider */
//$disabledProductProvider = $objectManager->get(DisabledProductProvider::class);
//$items = [];
//foreach ($disabledProductProvider->toGenerator($items) as $key => $data) {
//    echo ".";
//}
//
///** @var DisabledProductUrlProvider $disabledProductUrlProvider */
//$disabledProductUrlProvider = $objectManager->get(DisabledProductUrlProvider::class);
//foreach ($disabledProductUrlProvider->toGenerator() as $key => $data) {
//    echo ".";
//}
//
///** @var EntityUrlProvider $entityUrlProvider */
//$entityUrlProvider = $objectManager->get(EntityUrlProvider::class);
//foreach ($entityUrlProvider->toGenerator() as $key => $data) {
//    echo ".";
//}
//
///** @var HomePageUrlProvider $homePageUrlProvider */
//$homePageUrlProvider = $objectManager->get(HomePageUrlProvider::class);
//foreach ($homePageUrlProvider->toGenerator() as $key => $data) {
//    echo ".";
//}
//
///** @var MasterdataUrlProvider $masterdataUrlProvider */
//$masterdataUrlProvider = $objectManager->get(MasterdataUrlProvider::class);
//foreach ($masterdataUrlProvider->toGenerator() as $key => $data) {
//    echo ".";
//}
//
///** @var PageUrlProvider $pageUrlProvider */
//$pageUrlProvider = $objectManager->get(PageUrlProvider::class);
//foreach ($pageUrlProvider->toGenerator() as $key => $data) {
//    echo ".";
//}
//
///** @var PriceProvider $priceProvider */
//$priceProvider = $objectManager->get(PriceProvider::class);
//foreach ($priceProvider->toGenerator() as $key => $data) {
//    echo ".";
//}
//
///** @var ProductAttributeProvider $productAttributeProvider */
//$productAttributeProvider = $objectManager->get(ProductAttributeProvider::class);
//foreach ($productAttributeProvider->toGenerator() as $key => $data) {
//    echo ".";
//}
//
///** @var ProductProvider $productProvider */
//$productProvider = $objectManager->get(ProductProvider::class);
//$items = [];
//foreach ($productProvider->toGenerator($items) as $key => $data) {
//    echo ".";
//}
//
///** @var RelatedProvider $relatedProvider */
//$relatedProvider = $objectManager->get(RelatedProvider::class);
//foreach ($relatedProvider->toGenerator() as $key => $data) {
//    echo ".";
//}
//
///** @var StockProvider $stockProvider */
//$stockProvider = $objectManager->get(StockProvider::class);
//foreach ($stockProvider->toGenerator() as $key => $data) {
//    echo ".";
//}
//
///** @var VisibleProductProvider $visibleProductProvider */
//$visibleProductProvider = $objectManager->get(VisibleProductProvider::class);
//$items = [];
//foreach ($visibleProductProvider->toGenerator($items) as $key => $data) {
//    echo ".";
//}
//
///** @var CmsBlockProvider $cmsBlockProvider */
//$cmsBlockProvider = $objectManager->get(CmsBlockProvider::class);
//$items = [];
//foreach ($cmsBlockProvider->toGenerator($items) as $key => $data) {
//    echo ".";
//}
//
///** @var CmsPageProvider $cmsPageProvider */
//$cmsPageProvider = $objectManager->get(CmsPageProvider::class);
//$items = [];
//foreach ($cmsPageProvider->toGenerator($items) as $key => $data) {
//    echo ".";
//}

echo 'done' . PHP_EOL;

