| 1 |
<?php |
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 |
|
|---|
| 18 |
|
|---|
| 19 |
|
|---|
| 20 |
class ip2countryMapBuilder implements MapBuilder { |
|---|
| 21 |
|
|---|
| 22 |
|
|---|
| 23 |
* The (dot-path) name of this class |
|---|
| 24 |
*/ |
|---|
| 25 |
const CLASS_NAME = 'plugins.sfIpGeolocHelperPlugin.lib.model.map.ip2countryMapBuilder'; |
|---|
| 26 |
|
|---|
| 27 |
|
|---|
| 28 |
* The database map. |
|---|
| 29 |
*/ |
|---|
| 30 |
private $dbMap; |
|---|
| 31 |
|
|---|
| 32 |
|
|---|
| 33 |
* Tells us if this DatabaseMapBuilder is built so that we |
|---|
| 34 |
* don't have to re-build it every time. |
|---|
| 35 |
* |
|---|
| 36 |
* @return boolean true if this DatabaseMapBuilder is built, false otherwise. |
|---|
| 37 |
*/ |
|---|
| 38 |
public function isBuilt() |
|---|
| 39 |
{ |
|---|
| 40 |
return ($this->dbMap !== null); |
|---|
| 41 |
} |
|---|
| 42 |
|
|---|
| 43 |
|
|---|
| 44 |
* Gets the databasemap this map builder built. |
|---|
| 45 |
* |
|---|
| 46 |
* @return the databasemap |
|---|
| 47 |
*/ |
|---|
| 48 |
public function getDatabaseMap() |
|---|
| 49 |
{ |
|---|
| 50 |
return $this->dbMap; |
|---|
| 51 |
} |
|---|
| 52 |
|
|---|
| 53 |
|
|---|
| 54 |
* The doBuild() method builds the DatabaseMap |
|---|
| 55 |
* |
|---|
| 56 |
* @return void |
|---|
| 57 |
* @throws PropelException |
|---|
| 58 |
*/ |
|---|
| 59 |
public function doBuild() |
|---|
| 60 |
{ |
|---|
| 61 |
$this->dbMap = Propel::getDatabaseMap(ip2countryPeer::DATABASE_NAME); |
|---|
| 62 |
|
|---|
| 63 |
$tMap = $this->dbMap->addTable(ip2countryPeer::TABLE_NAME); |
|---|
| 64 |
$tMap->setPhpName('ip2country'); |
|---|
| 65 |
$tMap->setClassname('ip2country'); |
|---|
| 66 |
|
|---|
| 67 |
$tMap->setUseIdGenerator(false); |
|---|
| 68 |
|
|---|
| 69 |
$tMap->addPrimaryKey('IP_FROM', 'IpFrom', 'INTEGER', true, 20); |
|---|
| 70 |
|
|---|
| 71 |
$tMap->addColumn('IP_TO', 'IpTo', 'INTEGER', false, 20); |
|---|
| 72 |
|
|---|
| 73 |
$tMap->addColumn('COUNTRY_CODE2', 'CountryCode2', 'VARCHAR', true, 2); |
|---|
| 74 |
|
|---|
| 75 |
$tMap->addColumn('COUNTRY_CODE3', 'CountryCode3', 'VARCHAR', true, 2); |
|---|
| 76 |
|
|---|
| 77 |
$tMap->addColumn('COUNTRY_NAME', 'CountryName', 'VARCHAR', true, 50); |
|---|
| 78 |
|
|---|
| 79 |
} |
|---|
| 80 |
|
|---|
| 81 |
} |
|---|
| 82 |
|
|---|