KataoMemberMapBuilder.php 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. <?php
  2. /**
  3. * This class adds structure of 'katao_member' table to 'propel' DatabaseMap object.
  4. *
  5. *
  6. *
  7. * These statically-built map classes are used by Propel to do runtime db structure discovery.
  8. * For example, the createSelectSql() method checks the type of a given column used in an
  9. * ORDER BY clause to know whether it needs to apply SQL to make the ORDER BY case-insensitive
  10. * (i.e. if it's a text column type).
  11. *
  12. * @package lib.model.map
  13. */
  14. class KataoMemberMapBuilder {
  15. /**
  16. * The (dot-path) name of this class
  17. */
  18. const CLASS_NAME = 'lib.model.map.KataoMemberMapBuilder';
  19. /**
  20. * The database map.
  21. */
  22. private $dbMap;
  23. /**
  24. * Tells us if this DatabaseMapBuilder is built so that we
  25. * don't have to re-build it every time.
  26. *
  27. * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
  28. */
  29. public function isBuilt()
  30. {
  31. return ($this->dbMap !== null);
  32. }
  33. /**
  34. * Gets the databasemap this map builder built.
  35. *
  36. * @return the databasemap
  37. */
  38. public function getDatabaseMap()
  39. {
  40. return $this->dbMap;
  41. }
  42. /**
  43. * The doBuild() method builds the DatabaseMap
  44. *
  45. * @return void
  46. * @throws PropelException
  47. */
  48. public function doBuild()
  49. {
  50. $this->dbMap = Propel::getDatabaseMap('propel');
  51. $tMap = $this->dbMap->addTable('katao_member');
  52. $tMap->setPhpName('KataoMember');
  53. $tMap->setUseIdGenerator(true);
  54. $tMap->addPrimaryKey('ID', 'Id', 'int', CreoleTypes::INTEGER, true, null);
  55. $tMap->addColumn('KATAO_INDEX', 'KataoIndex', 'int', CreoleTypes::INTEGER, true, null);
  56. $tMap->addForeignKey('KATAO_NODE_ID', 'KataoNodeId', 'int', CreoleTypes::INTEGER, 'katao_node', 'ID', true, null);
  57. $tMap->addForeignKey('NEXT_KATAO_NODE_ID', 'NextKataoNodeId', 'int', CreoleTypes::INTEGER, 'katao_node', 'ID', false, null);
  58. $tMap->addForeignKey('KATAO_MEMBER_ID', 'KataoMemberId', 'int', CreoleTypes::INTEGER, 'katao_member', 'ID', false, null);
  59. $tMap->addColumn('FIRST_NAME', 'FirstName', 'string', CreoleTypes::VARCHAR, true, 255);
  60. $tMap->addColumn('LAST_NAME', 'LastName', 'string', CreoleTypes::VARCHAR, true, 255);
  61. $tMap->addColumn('ACCOUNTING_CODE', 'AccountingCode', 'string', CreoleTypes::CHAR, true, 6);
  62. $tMap->addColumn('ACCOUNTING_CODE_SOL', 'AccountingCodeSol', 'string', CreoleTypes::CHAR, true, 6);
  63. $tMap->addColumn('INITIAL_AMOUNT_EURO', 'InitialAmountEuro', 'double', CreoleTypes::FLOAT, false, null);
  64. $tMap->addColumn('INITIAL_AMOUNT_SOL', 'InitialAmountSol', 'int', CreoleTypes::INTEGER, false, null);
  65. $tMap->addColumn('IS_REFERER', 'IsReferer', 'int', CreoleTypes::INTEGER, false, 1);
  66. $tMap->addColumn('IS_DELEGATE', 'IsDelegate', 'int', CreoleTypes::INTEGER, false, 1);
  67. $tMap->addColumn('IS_ANONYMOUS', 'IsAnonymous', 'int', CreoleTypes::INTEGER, false, 1);
  68. $tMap->addColumn('IS_MEMBER', 'IsMember', 'int', CreoleTypes::INTEGER, false, 1);
  69. $tMap->addColumn('CARD_NUMBER_SOL', 'CardNumberSol', 'string', CreoleTypes::CHAR, false, 8);
  70. $tMap->addColumn('USER_SITUATION', 'UserSituation', 'string', CreoleTypes::VARCHAR, false, 255);
  71. $tMap->addColumn('USER_BIRTHDAY', 'UserBirthday', 'int', CreoleTypes::DATE, false, null);
  72. $tMap->addColumn('PARRAIN_NAME', 'ParrainName', 'string', CreoleTypes::VARCHAR, false, 255);
  73. $tMap->addColumn('CREATED_AT', 'CreatedAt', 'int', CreoleTypes::TIMESTAMP, false, null);
  74. $tMap->addColumn('UPDATED_AT', 'UpdatedAt', 'int', CreoleTypes::TIMESTAMP, false, null);
  75. } // doBuild()
  76. } // KataoMemberMapBuilder