<?php

namespace Sibs\Models;

use Db;

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

    /**
     * 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 Phone Number.
     *
     * @param int $customerID
     * @return mixed
     */
    public static function getPhoneNumber($customerID)
    {
        $table = self::getStaticTableName();

        $sqlQuery = "SELECT `phone`
            FROM `{$table}`
            WHERE `id_customer` = '$customerID'
            AND `deleted` = 0 ";

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