root/trunk/lib/model/map/SnippetUserMapBuilder.php

Revision 2, 2.2 kB (checked in by fabien, 6 years ago)

initial import

  • Property svn:mime-type set to text/x-php
  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
Line 
1 <?php
2         
3 require_once 'propel/map/MapBuilder.php';
4 include_once 'creole/CreoleTypes.php';
5
6
7 /**
8  * This class adds structure of 'sn_user' table to 'propel' DatabaseMap object.
9  *
10  *
11  *
12  * These statically-built map classes are used by Propel to do runtime db structure discovery.
13  * For example, the createSelectSql() method checks the type of a given column used in an
14  * ORDER BY clause to know whether it needs to apply SQL to make the ORDER BY case-insensitive
15  * (i.e. if it's a text column type).
16  *
17  * @package model.map
18  */   
19 class SnippetUserMapBuilder {
20
21     /**
22      * The (dot-path) name of this class
23      */
24     const CLASS_NAME = 'model.map.SnippetUserMapBuilder';   
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_user');
63         $tMap->setPhpName('SnippetUser');
64
65         $tMap->setUseIdGenerator(true);
66
67         $tMap->addPrimaryKey('ID', 'Id', 'int', CreoleTypes::INTEGER, true, null);
68
69         $tMap->addColumn('LOGIN', 'Login', 'string', CreoleTypes::VARCHAR, false);
70
71         $tMap->addColumn('PASSWORD', 'Password', 'string', CreoleTypes::VARCHAR, false);
72
73         $tMap->addColumn('EMAIL', 'Email', 'string', CreoleTypes::VARCHAR, false);
74
75         $tMap->addColumn('FIRST_NAME', 'FirstName', 'string', CreoleTypes::VARCHAR, false);
76
77         $tMap->addColumn('LAST_NAME', 'LastName', 'string', CreoleTypes::VARCHAR, false);
78
79         $tMap->addColumn('IS_ADMIN', 'IsAdmin', 'boolean', CreoleTypes::BOOLEAN, false);
80
81         $tMap->addColumn('CREATED_AT', 'CreatedAt', 'int', CreoleTypes::TIMESTAMP, false);
82                 
83     } // doBuild()
84
85 } // SnippetUserMapBuilder
86
Note: See TracBrowser for help on using the browser.