* @version SVN: $Id: Builder.php 7490 2010-03-29 19:53:27Z jwage $ */ abstract class BaseProfile extends sfDoctrineRecord { public function setTableDefinition() { $this->setTableName('profile'); $this->hasColumn('user_id', 'integer', null, array( 'type' => 'integer', 'notnull' => true, )); $this->hasColumn('type_id', 'integer', null, array( 'type' => 'integer', 'notnull' => true, )); $this->hasColumn('name', 'string', 255, array( 'type' => 'string', 'length' => 255, )); $this->hasColumn('first_name', 'string', 255, array( 'type' => 'string', 'length' => 255, )); $this->hasColumn('last_name', 'string', 255, array( 'type' => 'string', 'length' => 255, )); $this->hasColumn('prefix', 'string', 255, array( 'type' => 'string', 'length' => 255, )); $this->hasColumn('sufix', 'string', 255, array( 'type' => 'string', 'length' => 255, )); $this->hasColumn('tel', 'string', 255, array( 'type' => 'string', 'length' => 255, )); $this->hasColumn('mail', 'string', 255, array( 'type' => 'string', 'notnull' => true, 'unique' => true, 'length' => 255, )); $this->hasColumn('web', 'string', 255, array( 'type' => 'string', 'length' => 255, )); $this->hasColumn('country_id', 'integer', null, array( 'type' => 'integer', 'notnull' => true, )); $this->hasColumn('region_id', 'integer', null, array( 'type' => 'integer', 'notnull' => false, )); $this->hasColumn('city', 'string', 255, array( 'type' => 'string', 'length' => 255, )); $this->hasColumn('street', 'string', 255, array( 'type' => 'string', 'length' => 255, )); $this->hasColumn('zip', 'integer', null, array( 'type' => 'integer', )); $this->hasColumn('ic', 'string', 255, array( 'type' => 'string', 'length' => 255, )); $this->hasColumn('bank_account', 'string', 255, array( 'type' => 'string', 'length' => 255, )); $this->hasColumn('text', 'clob', null, array( 'type' => 'clob', )); $this->hasColumn('is_public', 'boolean', null, array( 'type' => 'boolean', 'notnull' => true, 'default' => true, )); $this->hasColumn('prepayment_type_id', 'integer', null, array( 'type' => 'integer', 'notnull' => true, 'default' => 1, )); $this->hasColumn('prepayment_from', 'date', null, array( 'type' => 'date', )); $this->hasColumn('prepayment_to', 'date', null, array( 'type' => 'date', )); $this->hasColumn('prepayment_active', 'boolean', null, array( 'type' => 'boolean', 'notnull' => false, 'default' => false, )); $this->hasColumn('filename', 'string', 255, array( 'type' => 'string', 'length' => 255, )); $this->hasColumn('representant_id', 'integer', null, array( 'type' => 'integer', )); $this->hasColumn('is_pdf_subscriber', 'boolean', null, array( 'type' => 'boolean', 'notnull' => true, 'default' => false, )); $this->hasColumn('is_eventer', 'boolean', null, array( 'type' => 'boolean', 'notnull' => true, 'default' => false, )); $this->option('collate', 'utf8_czech_ci'); $this->option('charset', 'utf8'); } public function setUp() { parent::setUp(); $this->hasOne('sfGuardUser as User', array( 'local' => 'user_id', 'foreign' => 'id', 'onDelete' => 'CASCADE')); $this->hasOne('ProfileType', array( 'local' => 'type_id', 'foreign' => 'id', 'onDelete' => 'CASCADE')); $this->hasOne('PrepaymentType', array( 'local' => 'prepayment_type_id', 'foreign' => 'id', 'onDelete' => 'CASCADE')); $this->hasOne('Region', array( 'local' => 'region_id', 'foreign' => 'id', 'onDelete' => 'CASCADE')); $this->hasOne('Country', array( 'local' => 'country_id', 'foreign' => 'id', 'onDelete' => 'CASCADE')); $this->hasOne('Representant', array( 'local' => 'representant_id', 'foreign' => 'id', 'onDelete' => 'SET NULL')); $this->hasMany('PrepaymentCount as PrepaymentCounts', array( 'local' => 'id', 'foreign' => 'profile_id')); $this->hasMany('Job as Jobs', array( 'local' => 'id', 'foreign' => 'profile_id')); $this->hasMany('Banner as Banners', array( 'local' => 'id', 'foreign' => 'profile_id')); $this->hasMany('Invoice as Invoices', array( 'local' => 'id', 'foreign' => 'profile_id')); $this->hasMany('InvoiceItem as InvoiceItems', array( 'local' => 'id', 'foreign' => 'profile_id')); $this->hasMany('Subscriber as Subscribers', array( 'local' => 'id', 'foreign' => 'profile_id')); $timestampable0 = new Doctrine_Template_Timestampable(); $sluggable0 = new Doctrine_Template_Sluggable(array( 'fields' => array( 0 => 'name', ), 'unique' => true, 'builder' => array( 0 => 'saInflector', 1 => 'urlize', ), )); $this->actAs($timestampable0); $this->actAs($sluggable0); } }