* @version SVN: $Id: Builder.php 7490 2010-03-29 19:53:27Z jwage $ */ abstract class BaseBanner extends sfDoctrineRecord { public function setTableDefinition() { $this->setTableName('banner'); $this->hasColumn('type_id', 'integer', null, array( 'type' => 'integer', 'notnull' => true, )); $this->hasColumn('profile_id', 'integer', null, array( 'type' => 'integer', 'notnull' => false, )); $this->hasColumn('filename', 'string', 255, array( 'type' => 'string', 'length' => 255, )); $this->hasColumn('note', 'string', 255, array( 'type' => 'string', 'length' => 255, )); $this->hasColumn('limit_from', 'date', null, array( 'type' => 'date', )); $this->hasColumn('limit_to', 'date', null, array( 'type' => 'date', )); $this->hasColumn('limit_clicks', 'integer', null, array( 'type' => 'integer', )); $this->hasColumn('limit_views', 'integer', null, array( 'type' => 'integer', )); $this->hasColumn('clicks_count', 'integer', null, array( 'type' => 'integer', 'notnull' => false, 'default' => 0, )); $this->hasColumn('views_count', 'integer', null, array( 'type' => 'integer', 'notnull' => false, 'default' => 0, )); $this->hasColumn('is_active', 'boolean', null, array( 'type' => 'boolean', 'notnull' => true, 'default' => true, )); $this->hasColumn('last_show', 'datetime', null, array( 'type' => 'datetime', 'notnull' => false, )); $this->hasColumn('show_token', 'boolean', null, array( 'type' => 'boolean', 'notnull' => 'frue', 'default' => false, )); $this->option('collate', 'utf8_czech_ci'); $this->option('charset', 'utf8'); } public function setUp() { parent::setUp(); $this->hasOne('BannerType as Type', array( 'local' => 'type_id', 'foreign' => 'id', 'onDelete' => 'CASCADE')); $this->hasMany('Region as Regions', array( 'refClass' => 'BannerRegionRelation', 'local' => 'banner_id', 'foreign' => 'region_id')); $this->hasOne('Profile', array( 'local' => 'profile_id', 'foreign' => 'id', 'onDelete' => 'CASCADE')); $this->hasMany('BannerRegionRelation as BannerRegionRelations', array( 'local' => 'id', 'foreign' => 'banner_id')); $this->hasMany('BannerClick as Clicks', array( 'local' => 'id', 'foreign' => 'banner_id')); $this->hasMany('InvoiceItem as InvoiceItems', array( 'local' => 'id', 'foreign' => 'banner_id')); $timestampable0 = new Doctrine_Template_Timestampable(); $this->actAs($timestampable0); } }