<?php

namespace Modules\RechercheArticles\Rules;

use Helpers\Outil\Roles;
use Psr\Http\Message\ServerRequestInterface;

class RechercheArticles
{
    protected ServerRequestInterface $request;
    protected \PDO $pdo;
        
    /**
     * __construct
     *
     * @param  ServerRequestInterface $request
     * @return void
     */
    public function __construct(ServerRequestInterface  $request, \PDO $pdo)
    {
        $this->request  = $request;
        $this->pdo      = $pdo;
    }
    
    /**
     * init
     *
     * @return bool
     */
    public function init() : bool
    {
        if ($_SESSION['IS_STE_VALIDE'] && Roles::droitsUtilisateur($this->pdo, 'HA_DA_CRE') || Roles::GetALL()) {
            return true;
        }
        return false;
    }


    /**
     * @return bool
     */
    public function recherche(): bool
    {
        return true;
    }

    /**
     * @return bool
     */
    public function ajaxGeneratePannel(): bool
    {
        return true;
    }

    /**
     * @return bool
     */
    public function cookiePannel(): bool
    {
        return true;
    }

    /**
     * @return bool
     */
    public function catalogueFavoris(): bool
    {
        return true;
    }

    /**
     * @return bool
     */
    public function favoris(): bool
    {
        return true;
    }

    /**
     * @return bool
     */
    public function addRemove(): bool
    {
        return true;
    }

    /**
     * @return bool
     */
    public function asynchroneRayon(): bool
    {
        return true;
    }

    /**
     * @return bool
     */
    // @phpcs:ignore
    public function ajaxGetNbrArtCata(): bool
    {
        return true;
    }

    /**
     * @return bool
     */
    // @phpcs:ignore
    public function ajaxGetRayon(): bool
    {
        return true;
    }
}
