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

class Core_Model_DbTable_States extends Engine_Db_Table {

  protected $_rowClass = 'Core_Model_State';
  
  function getCount($country_id){
    $select = $this->select()->where('country_id =?',$country_id);
    return engine_count($this->fetchAll($select));
  }
  
  function getStates($params = array()){
    $select = $this->select()->where('enabled =?',1)->order('name ASC')->where('country_id =?',$params['country_id']);
    return $this->fetchAll($select);
  }
}
