public function actionFeed()
{
// Получаем информацию о продуктах
- $productsInfo = MarketplaceService::getAllProductsInfo(10); // Получаем 10 товаров по умолчанию
+ $productsInfo = MarketplaceService::getAllProductsInfo(10);
// Генерируем XML-фид
$xmlFeed = MarketplaceService::createXMLFeed($productsInfo);
*
* @return array
*/
- public static function getAllProductsInfo($id, $marketplaceId = 2) // 2 = Flowwow по умолчанию
+ public static function getAllProductsInfo(int $items, $marketplaceId = 2) // 2 = Flowwow по умолчанию
{
$parents = ProductsClass::find()
->select('category_id')
->andWhere(['parent_id' => $parents])
->all();
- $count = (int)$id;
+ $count = (int)$items;
$selectedProducts = array_slice($products, 0, $count);
$result = [];