CcBlockTableMap.php 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. <?php
  2. /**
  3. * This class defines the structure of the 'cc_block' table.
  4. *
  5. *
  6. *
  7. * This map class is 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 propel.generator.airtime.map
  13. */
  14. class CcBlockTableMap extends TableMap {
  15. /**
  16. * The (dot-path) name of this class
  17. */
  18. const CLASS_NAME = 'airtime.map.CcBlockTableMap';
  19. /**
  20. * Initialize the table attributes, columns and validators
  21. * Relations are not initialized by this method since they are lazy loaded
  22. *
  23. * @return void
  24. * @throws PropelException
  25. */
  26. public function initialize()
  27. {
  28. // attributes
  29. $this->setName('cc_block');
  30. $this->setPhpName('CcBlock');
  31. $this->setClassname('CcBlock');
  32. $this->setPackage('airtime');
  33. $this->setUseIdGenerator(true);
  34. $this->setPrimaryKeyMethodInfo('cc_block_id_seq');
  35. // columns
  36. $this->addPrimaryKey('ID', 'DbId', 'INTEGER', true, null, null);
  37. $this->addColumn('NAME', 'DbName', 'VARCHAR', true, 255, '');
  38. $this->addColumn('MTIME', 'DbMtime', 'TIMESTAMP', false, 6, null);
  39. $this->addColumn('UTIME', 'DbUtime', 'TIMESTAMP', false, 6, null);
  40. $this->addForeignKey('CREATOR_ID', 'DbCreatorId', 'INTEGER', 'cc_subjs', 'ID', false, null, null);
  41. $this->addColumn('DESCRIPTION', 'DbDescription', 'VARCHAR', false, 512, null);
  42. $this->addColumn('LENGTH', 'DbLength', 'VARCHAR', false, null, '00:00:00');
  43. $this->addColumn('TYPE', 'DbType', 'VARCHAR', false, 7, 'static');
  44. // validators
  45. } // initialize()
  46. /**
  47. * Build the RelationMap objects for this table relationships
  48. */
  49. public function buildRelations()
  50. {
  51. $this->addRelation('CcSubjs', 'CcSubjs', RelationMap::MANY_TO_ONE, array('creator_id' => 'id', ), 'CASCADE', null);
  52. $this->addRelation('CcPlaylistcontents', 'CcPlaylistcontents', RelationMap::ONE_TO_MANY, array('id' => 'block_id', ), 'CASCADE', null);
  53. $this->addRelation('CcBlockcontents', 'CcBlockcontents', RelationMap::ONE_TO_MANY, array('id' => 'block_id', ), 'CASCADE', null);
  54. $this->addRelation('CcBlockcriteria', 'CcBlockcriteria', RelationMap::ONE_TO_MANY, array('id' => 'block_id', ), 'CASCADE', null);
  55. } // buildRelations()
  56. /**
  57. *
  58. * Gets the list of behaviors registered for this table
  59. *
  60. * @return array Associative array (name => parameters) of behaviors
  61. */
  62. public function getBehaviors()
  63. {
  64. return array(
  65. 'aggregate_column' => array('name' => 'length', 'expression' => 'SUM(cliplength)', 'foreign_table' => 'cc_blockcontents', ),
  66. );
  67. } // getBehaviors()
  68. } // CcBlockTableMap