PageRenderTime 52ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 0ms

/workflow/engine/classes/model/map/ContentMapBuilder.php

https://bitbucket.org/ferOnti/processmaker
PHP | 84 lines | 30 code | 19 blank | 35 comment | 0 complexity | c105ef5adc1b60da512ab0b91472cab9 MD5 | raw file
  1. <?php
  2. require_once 'propel/map/MapBuilder.php';
  3. include_once 'creole/CreoleTypes.php';
  4. /**
  5. * This class adds structure of 'CONTENT' table to 'workflow' DatabaseMap object.
  6. *
  7. *
  8. *
  9. * These statically-built map classes are used by Propel to do runtime db structure discovery.
  10. * For example, the createSelectSql() method checks the type of a given column used in an
  11. * ORDER BY clause to know whether it needs to apply SQL to make the ORDER BY case-insensitive
  12. * (i.e. if it's a text column type).
  13. *
  14. * @package workflow.classes.model.map
  15. */
  16. class ContentMapBuilder
  17. {
  18. /**
  19. * The (dot-path) name of this class
  20. */
  21. const CLASS_NAME = 'classes.model.map.ContentMapBuilder';
  22. /**
  23. * The database map.
  24. */
  25. private $dbMap;
  26. /**
  27. * Tells us if this DatabaseMapBuilder is built so that we
  28. * don't have to re-build it every time.
  29. *
  30. * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
  31. */
  32. public function isBuilt()
  33. {
  34. return ($this->dbMap !== null);
  35. }
  36. /**
  37. * Gets the databasemap this map builder built.
  38. *
  39. * @return the databasemap
  40. */
  41. public function getDatabaseMap()
  42. {
  43. return $this->dbMap;
  44. }
  45. /**
  46. * The doBuild() method builds the DatabaseMap
  47. *
  48. * @return void
  49. * @throws PropelException
  50. */
  51. public function doBuild()
  52. {
  53. $this->dbMap = Propel::getDatabaseMap('workflow');
  54. $tMap = $this->dbMap->addTable('CONTENT');
  55. $tMap->setPhpName('Content');
  56. $tMap->setUseIdGenerator(false);
  57. $tMap->addPrimaryKey('CON_CATEGORY', 'ConCategory', 'string', CreoleTypes::VARCHAR, true, 30);
  58. $tMap->addPrimaryKey('CON_PARENT', 'ConParent', 'string', CreoleTypes::VARCHAR, true, 32);
  59. $tMap->addPrimaryKey('CON_ID', 'ConId', 'string', CreoleTypes::VARCHAR, true, 100);
  60. $tMap->addPrimaryKey('CON_LANG', 'ConLang', 'string', CreoleTypes::VARCHAR, true, 10);
  61. $tMap->addColumn('CON_VALUE', 'ConValue', 'string', CreoleTypes::LONGVARCHAR, true, null);
  62. $tMap->addValidator('CON_LANG', 'maxLength', 'propel.validator.MaxLengthValidator', '5', 'Language can be no larger than 5 in size');
  63. $tMap->addValidator('CON_LANG', 'required', 'propel.validator.RequiredValidator', '', 'Language is required.');
  64. } // doBuild()
  65. } // ContentMapBuilder