| 1 |
<?php |
|---|
| 2 |
|
|---|
| 3 |
require_once 'propel/map/MapBuilder.php'; |
|---|
| 4 |
include_once 'creole/CreoleTypes.php'; |
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 |
|
|---|
| 18 |
|
|---|
| 19 |
class SnippetVoteMapBuilder { |
|---|
| 20 |
|
|---|
| 21 |
|
|---|
| 22 |
* The (dot-path) name of this class |
|---|
| 23 |
*/ |
|---|
| 24 |
const CLASS_NAME = 'model.map.SnippetVoteMapBuilder'; |
|---|
| 25 |
|
|---|
| 26 |
|
|---|
| 27 |
* The database map. |
|---|
| 28 |
*/ |
|---|
| 29 |
private $dbMap; |
|---|
| 30 |
|
|---|
| 31 |
|
|---|
| 32 |
* Tells us if this DatabaseMapBuilder is built so that we |
|---|
| 33 |
* don't have to re-build it every time. |
|---|
| 34 |
* |
|---|
| 35 |
* @return boolean true if this DatabaseMapBuilder is built, false otherwise. |
|---|
| 36 |
*/ |
|---|
| 37 |
public function isBuilt() |
|---|
| 38 |
{ |
|---|
| 39 |
return ($this->dbMap !== null); |
|---|
| 40 |
} |
|---|
| 41 |
|
|---|
| 42 |
|
|---|
| 43 |
* Gets the databasemap this map builder built. |
|---|
| 44 |
* |
|---|
| 45 |
* @return the databasemap |
|---|
| 46 |
*/ |
|---|
| 47 |
public function getDatabaseMap() |
|---|
| 48 |
{ |
|---|
| 49 |
return $this->dbMap; |
|---|
| 50 |
} |
|---|
| 51 |
|
|---|
| 52 |
|
|---|
| 53 |
* The doBuild() method builds the DatabaseMap |
|---|
| 54 |
* |
|---|
| 55 |
* @return void |
|---|
| 56 |
* @throws PropelException |
|---|
| 57 |
*/ |
|---|
| 58 |
public function doBuild() |
|---|
| 59 |
{ |
|---|
| 60 |
$this->dbMap = Propel::getDatabaseMap('propel'); |
|---|
| 61 |
|
|---|
| 62 |
$tMap = $this->dbMap->addTable('sn_vote'); |
|---|
| 63 |
$tMap->setPhpName('SnippetVote'); |
|---|
| 64 |
|
|---|
| 65 |
$tMap->setUseIdGenerator(true); |
|---|
| 66 |
|
|---|
| 67 |
$tMap->addPrimaryKey('ID', 'Id', 'int', CreoleTypes::INTEGER, true, null); |
|---|
| 68 |
|
|---|
| 69 |
$tMap->addForeignKey('USER_ID', 'UserId', 'int', CreoleTypes::INTEGER, 'sn_user', 'ID', false, null); |
|---|
| 70 |
|
|---|
| 71 |
$tMap->addForeignKey('SNIPPET_ID', 'SnippetId', 'int', CreoleTypes::INTEGER, 'sn_snippet', 'ID', false, null); |
|---|
| 72 |
|
|---|
| 73 |
$tMap->addColumn('VOTE', 'Vote', 'int', CreoleTypes::INTEGER, false); |
|---|
| 74 |
|
|---|
| 75 |
$tMap->addColumn('CREATED_AT', 'CreatedAt', 'int', CreoleTypes::TIMESTAMP, false); |
|---|
| 76 |
|
|---|
| 77 |
} |
|---|
| 78 |
|
|---|
| 79 |
} |
|---|
| 80 |
|
|---|