<?php

declare(strict_types=1);

namespace portalpeople\products\services;

use backend\models\Productsbe;

/**
 * ProductsService
 *
 * Provides product data retrieval for API consumers.
 * Extracted from api/modules/v1/controllers/ProductsController.
 */
class ProductsService
{
    /**
     * Return all active products as a plain array.
     *
     * @return array<int, array<string, mixed>>
     */
    public function getCenterProducts(): array
    {
        return Productsbe::find()
            ->where(['products.status' => 'active'])
            ->asArray()
            ->all();
    }
}
