<?php
namespace TourOperatorProAdminWoopanel\app\models;
defined('_TOUROPERATOR_EXEC') or die;

use Exception;
use TourOperatorPro\Factory;
use TourOperatorPro\Filesystem\File as FileAlias;
use TourOperatorPro\Language\Text;
use TourOperatorPro\Mvc\Model\Model;
use TourOperatorPro\Mvc\Model\ModelForm;
use TourOperatorPro\Form\Form;
use TourOperatorPro\Mvc\Model\ModelList;
use TourOperatorPro\Registry\Registry;
use TourOperatorPro\Utilities\Utility;

class CurrencyModel extends ModelForm
{
    /**
     * @var string
     */
    public $context = "currency";
    /**
     * @var string
     */
    public $table_name = "currency";

    public function format_currency($based = "USD"){
        $db=$this->_db;
        $query=$db->getQuery(true);
        $query->select('currency.symbol')
            ->from($this->getTableName('currency').' AS currency')
            ->where('currency.code='.$query->quote($based));
        $code = $this->_db->setQuery($query)->loadObject();
        return $code;
    }

}
