Manufacturer tree loader

@param string $sActManufacturer active Manufacturer id
767555
protected function _loadManufacturerTree($sActManufacturer)
    {
        $myConfig = \OxidEsales\Eshop\Core\Registry::getConfig();
        if ($myConfig->getConfigParam('bl_perfLoadManufacturerTree')) {
            $oManufacturerTree = $this->getManufacturerList();
            $shopHomeURL = $myConfig->getShopHomeUrl();
            $oManufacturerTree->buildManufacturerTree('manufacturerlist', $sActManufacturer, $shopHomeURL);

            $oParentView = $this->getParent();

            // setting active Manufacturer list
            $oParentView->setManufacturerTree($oManufacturerTree);
            $this->setManufacturerTree($oManufacturerTree);

            // setting active Manufacturer
            if (($oManufacturer = $oManufacturerTree->getClickManufacturer())) {
                $oParentView->setActManufacturer($oManufacturer);
            }
        }
    }
506351
public function getManufacturerList($sType, $sValue)
    {
        $oMnfTree = oxNew(\OxidEsales\Eshop\Application\Model\ManufacturerList::class);
        $oMnfTree->loadManufacturerList();
        if ($sType === 'mnf') {
            foreach ($oMnfTree as $oManufacturer) {
                if ($oManufacturer->oxmanufacturers__oxid->value == $sValue) {
                    $oManufacturer->selected = 1;
                    break;
                }
            }
        }

        return $oMnfTree;
    }
1324353
protected function _loadArticles($oManufacturer)
    {
        $sManufacturerId = $oManufacturer->getId();

        // load only articles which we show on screen
        $iNrofCatArticles = (int) \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('iNrofCatArticles');
        $iNrofCatArticles = $iNrofCatArticles ? $iNrofCatArticles : 1;

        $oArtList = oxNew(\OxidEsales\Eshop\Application\Model\ArticleList::class);
        $oArtList->setSqlLimit($iNrofCatArticles * $this->_getRequestPageNr(), $iNrofCatArticles);
        $oArtList->setCustomSorting($this->getSortingSql($this->getSortIdent()));

        // load the articles
        $this->_iAllArtCnt = $oArtList->loadManufacturerArticles($sManufacturerId, $oManufacturer);

        // counting pages
        $this->_iCntPages = ceil($this->_iAllArtCnt / $iNrofCatArticles);

        return [$oArtList, $this->_iAllArtCnt];
    }
1202215
public static function setLoader($loader) {
    if (!$loader) {
      self::$_loader = NULL;
      return;
    }
    if ($loader instanceof FluentDOM\Loadable) {
      self::$_loader = $loader;
      return;
    }
    throw new FluentDOM\Exceptions\InvalidArgument(
      'loader', [Loadable::class]
    );
  }
228028
public function addDefaultSerializers(SerializerInterface $jmsSerializer): EntryPoint
    {
        $this->addSerializer(new ArticleHandler($jmsSerializer));
        $this->addSerializer(new OrderHandler($jmsSerializer));
        $this->addSerializer(new CategoryHandler($jmsSerializer));
        $this->addSerializer(new MediaHandler($jmsSerializer));
        $this->addSerializer(new ManufacturerHandler($jmsSerializer));

        return $this;
    }
1170605
public function registerAutoloaders($dependencyInjector)
    {
        if ($this::DIR != null) {
            $namespace = substr(get_class($this), 0, strripos(get_class($this), '\\'));
            $loader = $dependencyInjector->get('loader');
            $loader->registerNamespaces([$namespace => $this::DIR . '/']);
            $loader->register();
        }
    }
699011
public function setUploader($uploader, $info = null)
    {
        self::$xml['uploader'] = VideoItemUploaderTags::setUploader($this->validator, $uploader, $info);
    }
116226
public function load(ObjectManager $manager)
    {
        /**
         * Product.
         *
         * @var CategoryInterface     $category
         * @var ManufacturerInterface $manufacturer
         * @var CurrencyInterface     $currency
         * @var ObjectDirector        $productDirector
         */
        $category = $this->getReference('category');
        $rootCategory = $this->getReference('rootCategory');
        $manufacturer = $this->getReference('manufacturer');
        $currency = $this->getReference('currency-dollar');
        $productDirector = $this->getDirector('product');

        $product = $productDirector
            ->create()
            ->setName('product')
            ->setSlug('product')
            ->setDescription('my product description')
            ->setShortDescription('my product short description')
            ->addCategory($category)
            ->setPrincipalCategory($category)
            ->setManufacturer($manufacturer)
            ->setStock(10)
            ->setPrice(Money::create(1000, $currency))
            ->setSku('product-sku-code-1')
            ->setHeight(10)
            ->setWidth(15)
            ->setDepth(20)
            ->setWeight(100)
            ->setEnabled(true);

        $productDirector->save($product);
        $this->addReference('product', $product);

        /**
         * Reduced Product.
         */
        $productReduced = $productDirector
            ->create()
            ->setName('product-reduced')
            ->setSlug('product-reduced')
            ->setDescription('my product-reduced description')
            ->setShortDescription('my product-reduced short description')
            ->setShowInHome(true)
            ->setStock(5)
            ->setPrice(Money::create(1000, $currency))
            ->setReducedPrice(Money::create(500, $currency))
            ->setHeight(25)
            ->setWidth(30)
            ->setDepth(35)
            ->setWeight(200)
            ->setEnabled(true);

        $this->storeProductImage(
            $productReduced,
            'product.jpg'
        );

        $productDirector->save($productReduced);
        $this->addReference('product-reduced', $productReduced);

        /**
         * Product with variants.
         *
         * @var ProductInterface $productWithVariants
         */
        $productWithVariants = $productDirector
            ->create()
            ->setName('Product with variants')
            ->setSku('product-sku-code-variant-1')
            ->setSlug('product-with-variants')
            ->setDescription('my product with variants description')
            ->setShortDescription('my product with variants short description')
            ->addCategory($category)
            ->setPrincipalCategory($category)
            ->setManufacturer($manufacturer)
            ->setStock(10)
            ->setPrice(Money::create(1000, $currency))
            ->setHeight(40)
            ->setWidth(45)
            ->setDepth(50)
            ->setWeight(500)
            ->setEnabled(true);

        $productDirector->save($productWithVariants);
        $this->addReference('product-with-variants', $productWithVariants);

        /**
         * Root category product.
         *
         * @var ProductInterface $rootCategoryProduct
         */
        $rootCategoryProduct = $productDirector
            ->create()
            ->setName('Root category product')
            ->setSlug('root-category-product')
            ->setDescription('my product description')
            ->setShortDescription('my product short description')
            ->addCategory($rootCategory)
            ->setPrincipalCategory($rootCategory)
            ->setManufacturer($manufacturer)
            ->setStock(10)
            ->setPrice(Money::create(500, $currency))
            ->setSku('product-sku-code-3')
            ->setHeight(10)
            ->setWidth(15)
            ->setDepth(20)
            ->setWeight(100)
            ->setEnabled(true);

        $productDirector->save($rootCategoryProduct);
        $this->addReference('rootCategoryProduct', $rootCategoryProduct);
    }
334546
public static function createFromAssetsLoader(AssetsLoader $loader)
    {
        $_class = get_called_class();
        return new $_class(
            $loader->getRootDirectory(),
            $loader->getAssetsDirectory(),
            $loader->getVendorDirectory(),
            $loader->getAssetsVendorDirectory()
        );
    }
597913
protected function addProductMeasurementSalesUnitCheckToHeap(string $productSku): void
    {
        if (isset(static::$productMeasurementSalesUnitHeap[$productSku])) {
            return;
        }

        if (static::$productMeasurementSalesUnitHeapSize >= static::HEAP_LIMIT) {
            $this->clearProductMeasurementSalesUnitHeap();
        }

        $productConcreteId = $this->getIdProductBySku($productSku);

        static::$productMeasurementSalesUnitHeapSize++;
        static::$productMeasurementSalesUnitHeap[$productSku] = $this->getProductMeasurementSalesUnitQuery()
            ->filterByFkProduct($productConcreteId)
            ->exists();
    }
1231352
protected function loadManager($loader, ContainerBuilder $container, array $config)
    {
        if (isset($config['manager']['class'])) {
            $container->setParameter('snide_travinizer.repo_manager.class', $config['manager']['class']);
        }
    }
742154
public function load(ObjectManager $manager)
    {
        /**
         * Pack.
         *
         * @var CategoryInterface     $category
         * @var ManufacturerInterface $manufacturer
         * @var CurrencyInterface     $currency
         * @var ObjectDirector        $packDirector
         */
        $category = $this->getReference('category');
        $manufacturer = $this->getReference('manufacturer');
        $product = $this->getReference('product');
        $productReduced = $this->getReference('product-reduced');
        $variant = $this->getReference('variant-red-small');
        $currency = $this->getReference('currency-dollar');
        $packDirector = $this->getDirector('purchasable_pack');

        // Id assigned = 9
        $pack = $packDirector
            ->create()
            ->setName('pack')
            ->setSlug('pack')
            ->setDescription('my pack description')
            ->setShortDescription('my pack short description')
            ->addCategory($category)
            ->setPrincipalCategory($category)
            ->setManufacturer($manufacturer)
            ->addPurchasable($product)
            ->addPurchasable($productReduced)
            ->addPurchasable($variant)
            ->setStockType(ElcodiProductStock::SPECIFIC_STOCK)
            ->setStock(10)
            ->setPrice(Money::create(5000, $currency))
            ->setSku('pack-sku-code-1')
            ->setHeight(30)
            ->setWidth(30)
            ->setDepth(30)
            ->setWeight(200)
            ->setEnabled(true);

        $packDirector->save($pack);
        $this->addReference('pack', $pack);

        // Id assigned = 10
        $packInherit = $packDirector
            ->create()
            ->setName('pack-inherit')
            ->setSlug('pack-inherit')
            ->setDescription('my pack inherit description')
            ->setShortDescription('my pack inherit short description')
            ->addCategory($category)
            ->setPrincipalCategory($category)
            ->setManufacturer($manufacturer)
            ->addPurchasable($product)
            ->addPurchasable($productReduced)
            ->addPurchasable($variant)
            ->setStockType(ElcodiProductStock::INHERIT_STOCK)
            ->setPrice(Money::create(5000, $currency))
            ->setSku('pack-inherit-sku-code-1')
            ->setHeight(30)
            ->setWidth(30)
            ->setDepth(30)
            ->setWeight(200)
            ->setEnabled(true);

        $this->storeProductImage(
            $packInherit,
            'pack.jpg'
        );

        $packDirector->save($packInherit);
        $this->addReference('pack-inherit', $packInherit);
    }
815374
public function getProductAbstractCollectionByBrand(BrandTransfer $brandTransfer): BrandProductAbstractRelationTransfer
    {
        $brandTransfer->requireIdBrand();

        return $this->brandProductRepository->getProductAbstractCollectionByBrandId($brandTransfer->getIdBrand());
    }
539304
public function getManufacturerList()
    {
        $oManufacturerList = oxNew(\OxidEsales\Eshop\Application\Model\ManufacturerList::class);
        $oManufacturerList->loadManufacturerList();

        return $oManufacturerList;
    }
749376
public function setLoader(ServiceLoader $loader){

		$this->loader = $loader;
		$that = $this;

		$this->loader->addInitializer(function ($instance) use ($that) {

		    // Inject broker to services
		    if ($instance instanceof Feature\ServiceBrokerAwareInterface) {
		        $instance->setServiceBroker($that);
		    }

		    // Inject event manager to services
		    if ($instance instanceof EventManagerAwareInterface) {
		        $instance->setEventManager($that->getEventManager());
		    }
		});

		return $this;
	}
849361
public Manufacturer updateManufacturer(Long id, Manufacturer manufacturer) {
        manufacturer.setId(id);
        return manufacturerRepository.createOrUpdate(manufacturer);
    }
1160558
private function loadValidatorLoader(string $entityManagerName, ContainerBuilder $container) : void
    {
        if (! interface_exists(LoaderInterface::class) || ! class_exists(DoctrineLoader::class)) {
            return;
        }

        $validatorLoaderDefinition = $container->register(sprintf('doctrine.orm.%s_entity_manager.validator_loader', $entityManagerName), DoctrineLoader::class);
        $validatorLoaderDefinition->addArgument(new Reference(sprintf('doctrine.orm.%s_entity_manager', $entityManagerName)));

        $validatorLoaderDefinition->addTag('validator.auto_mapper', ['priority' => -100]);
    }