Files
kupshop/bundles/KupShop/FeedsBundle/Wrapper/PriceLevelsWrapper.php
2025-08-02 16:30:27 +02:00

30 lines
736 B
PHP

<?php
namespace KupShop\FeedsBundle\Wrapper;
class PriceLevelsWrapper extends ObjectMultiWrapper
{
protected \Product $product;
protected static array $allPriceLevels;
public function __construct(PriceLevelsWrapperFactory $wrapperFactory)
{
parent::__construct($wrapperFactory);
}
/** @private */
public function setProduct(\Product $product): PriceLevelsWrapper
{
if (!isset(static::$allPriceLevels)) {
static::$allPriceLevels = sqlFetchAll(sqlQueryBuilder()->select('id')->from('price_levels')->execute(), ['id' => 'id']);
}
$this->objects = static::$allPriceLevels;
$this->wrapperFactory->setProduct($product);
return $this;
}
}