* @version SVN: $Id: Builder.php 7490 2010-03-29 19:53:27Z jwage $ */ abstract class BaseEvent extends sfDoctrineRecord { public function setTableDefinition() { $this->setTableName('event'); $this->hasColumn('profile_id', 'integer', null, array( 'type' => 'integer', 'notnull' => false, )); $this->hasColumn('name', 'string', 255, array( 'type' => 'string', 'notnull' => true, 'length' => 255, )); $this->hasColumn('perex', 'clob', null, array( 'type' => 'clob', )); $this->hasColumn('text', 'clob', null, array( 'type' => 'clob', )); $this->hasColumn('contact', 'string', 255, array( 'type' => 'string', 'length' => 255, )); $this->hasColumn('logo', 'string', 255, array( 'type' => 'string', 'length' => 255, )); $this->hasColumn('date_from', 'timestamp', null, array( 'type' => 'timestamp', 'notnull' => true, )); $this->hasColumn('date_to', 'timestamp', null, array( 'type' => 'timestamp', 'notnull' => true, )); $this->hasColumn('region_id', 'integer', null, array( 'type' => 'integer', 'notnull' => true, )); $this->hasColumn('city', 'string', 255, array( 'type' => 'string', 'length' => 255, )); $this->option('collate', 'utf8_czech_ci'); $this->option('charset', 'utf8'); } public function setUp() { parent::setUp(); $this->hasOne('Profile', array( 'local' => 'profile_id', 'foreign' => 'id', 'onDelete' => 'CASCADE')); $this->hasOne('Region', array( 'local' => 'region_id', 'foreign' => 'id', 'onDelete' => 'CASCADE')); $this->hasMany('JobCategory as Categories', array( 'refClass' => 'EventCategoryRelation', 'local' => 'event_id', 'foreign' => 'category_id')); $this->hasMany('EventCategoryRelation as EventCategoryRelations', array( 'local' => 'id', 'foreign' => 'event_id')); $timestampable0 = new Doctrine_Template_Timestampable(); $this->actAs($timestampable0); } }