<?php
/**
  * Ahead WebSoft Technologies Pvt Ltd.
  * @copyright  Copyright 2006-2026 Ahead WebSoft Technologies Pvt Ltd.
  * @license    https://www.socialengine.com/policies
*/

class Payment_Model_DbTable_Currencies extends Engine_Db_Table {

  protected $_rowClass = 'Payment_Model_Currency';
  
  public function getCurrencies($params = array()) {
  
    $tableName = $this->info('name');
    $select = $this->select();

    if(isset($params['enabled']) && !empty($params['enabled']))
      $select->where('enabled =?', $params['enabled']);
    
    $select->order('order ASC');
    
    return $this->fetchAll($select);
  }
  
  public function getCurrency($code) {
  
    $tableName = $this->info('name');
    $select = $this->select()
                  ->where('code =?', $code);

    return $this->fetchRow($select);
  }
}
