<?php

namespace Sibs\Models;

use Db;

class PrestashopConfiguration extends SibsModels
{
    /**
     * Get Static Table Name.
     *
     * @return bool
     */
    public static function getStaticTableName(): string
    {
        return _DB_PREFIX_ . 'configuration';
    }

    /**
     * Get Static Config Name.
     *
     * @return bool
     */
    public static function getStaticConfigName(): string
    {
        return '';
    }

    /**
     * Create Model.
     *
     * @return bool
     */
    public static function create(): bool
    {
        return true;
    }

    /**
     * Seed Model.
     *
     * @return bool
     */
    public static function seed(): bool
    {
        return true;
    }

    /**
     * Get Configuration ID.
     *
     * @param array $params
     * @return mixed
     */
    public static function getConfigurationId($params)
    {
        $config_key = $params['config_key'];
        $table      = self::getStaticTableName();

        $statusSql = "SELECT `id_configuration`
            FROM `{$table}`
            WHERE `name` = '{$config_key}' ";

        return Db::getInstance()->getValue($statusSql);
    }
}
