| Server IP : 172.67.178.83 / Your IP : 216.73.217.141 Web Server : Apache System : Linux hosting01.arsenalhost.com 4.18.0-425.13.1.lve.el8.x86_64 #1 SMP Mon Feb 27 15:23:24 EST 2023 x86_64 User : corbizre ( 1013) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /home/corbizre/gotofindhomes.com3/components/Address/State/ |
Upload File : |
<?php
/**
* Documentation
* @author evgeniy
* @category
* @package
* @subpackage
* @copyright Copyright (c) 2005-2012 ITCrimea Ukraine Inc. (http://www.itcrimea.com)
* @license
*/
class Address_State_Table extends System_Db_Table
{
/**
* Documentation
* @var mixed
*/
protected static $_instance = null;
/**
* Documentation
* @var mixed
*/
protected $_name = 'address_states';
/**
* Documentation
* @var mixed
*/
protected $_dependentTables = array();
/**
* Documentation
* @var mixed
*/
protected $_referenceMap = array();
/**
* Look for state in Database
* @param string $state
* @return string|null
*/
public function checkState($state)
{
//Try to find state in DB
$objState = $this->fetchRow($this->select()->from($this->_name, array('short2ch'))->where('short2ch = ?', $state)
->orWhere('Name = ?',$state));
if(is_object($objState)){
return $objState->short2ch;
}else{
return NULL;
}
}
/**
* Look for state in Database
* @param string $state
* @return boolean
*/
public function checkStateByShort2ch($state)
{
//Try to find state in DB
$objState = $this->fetchRow($this->select()->from($this->_name, array('ID'))->where('short2ch = ?', $state));
if (is_object($objState)) {
return true;
} else {
return false;
}
}
/**
* @param string $short2ch
* @return string|null
*/
public function getNameByShort($short2ch)
{
$objState = $this->fetchRow($this->select()->where('short2ch = ?', $short2ch));
if(is_object($objState)){
return $objState->Name;
}else{
return NULL;
}
}
public function fetchAllSorted()
{
return $this->fetchAll($this->select()->order('Name'));
}
}