setName('cc_block'); $this->setPhpName('CcBlock'); $this->setClassname('CcBlock'); $this->setPackage('airtime'); $this->setUseIdGenerator(true); $this->setPrimaryKeyMethodInfo('cc_block_id_seq'); // columns $this->addPrimaryKey('ID', 'DbId', 'INTEGER', true, null, null); $this->addColumn('NAME', 'DbName', 'VARCHAR', true, 255, ''); $this->addColumn('MTIME', 'DbMtime', 'TIMESTAMP', false, 6, null); $this->addColumn('UTIME', 'DbUtime', 'TIMESTAMP', false, 6, null); $this->addForeignKey('CREATOR_ID', 'DbCreatorId', 'INTEGER', 'cc_subjs', 'ID', false, null, null); $this->addColumn('DESCRIPTION', 'DbDescription', 'VARCHAR', false, 512, null); $this->addColumn('LENGTH', 'DbLength', 'VARCHAR', false, null, '00:00:00'); $this->addColumn('TYPE', 'DbType', 'VARCHAR', false, 7, 'static'); // validators } // initialize() /** * Build the RelationMap objects for this table relationships */ public function buildRelations() { $this->addRelation('CcSubjs', 'CcSubjs', RelationMap::MANY_TO_ONE, array('creator_id' => 'id', ), 'CASCADE', null); $this->addRelation('CcPlaylistcontents', 'CcPlaylistcontents', RelationMap::ONE_TO_MANY, array('id' => 'block_id', ), 'CASCADE', null); $this->addRelation('CcBlockcontents', 'CcBlockcontents', RelationMap::ONE_TO_MANY, array('id' => 'block_id', ), 'CASCADE', null); $this->addRelation('CcBlockcriteria', 'CcBlockcriteria', RelationMap::ONE_TO_MANY, array('id' => 'block_id', ), 'CASCADE', null); } // buildRelations() /** * * Gets the list of behaviors registered for this table * * @return array Associative array (name => parameters) of behaviors */ public function getBehaviors() { return array( 'aggregate_column' => array('name' => 'length', 'expression' => 'SUM(cliplength)', 'foreign_table' => 'cc_blockcontents', ), ); } // getBehaviors() } // CcBlockTableMap