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

use TourOperatorPro\Factory;
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;
    }
    public function save($data = array())
    {
        return parent::save($data); // TODO: Change the autogenerated stub
    }
}
