{ return $this->_searchModel->getAddressByPostcode($postcode); } public function processCitySimilarity($city) { return $this->_searchModel->processCitySimilarity($city); } public function identifyRegionByCity($city) { return $this->_searchModel->identifyRegionByCity($city); } /** * @param string $postcode * - perform a search in database to see if the postcode is valid * * @return mixed */ public function isValid($postcode) { } public function isEnabled($country) { $country = $this->applyInputFilter(0, $country); if ($country == 'romania') { return true; } return false; } } Zitec_Dpd_Postcode_Search::autoloadRegister();
/** * return install script for zitec_dpd_postcodes * * @return string */ public function getInsertScripts() { $sqlData = Zitec_Dpd_Postcode_Search::getBasePath() . DIRECTORY_SEPARATOR . 'Zitec' . DIRECTORY_SEPARATOR . 'Dpd' . DIRECTORY_SEPARATOR . 'Postcode' . DIRECTORY_SEPARATOR . 'data' . DIRECTORY_SEPARATOR . 'data.sql'; $insertSql = file_get_contents($sqlData); $insertSql = str_replace('zitec_dpd_postcodes', self::TABLE_NAME, $insertSql); return $insertSql; }
public static function getBasePath() { if (empty(self::$base_path)) { $baseDir = dirname(dirname(dirname(dirname(dirname(__FILE__))))); Zitec_Dpd_Postcode_Search::$base_path = $baseDir; } return self::$base_path; }