setTableName('representant_user'); $this->hasColumn('user_id', 'integer', null, array( 'type' => 'integer', 'notnull' => true, )); $this->hasColumn('representant_id', 'integer', null, array( 'type' => 'integer', 'notnull' => true, )); $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('sfGuardUser as Representant', array( 'local' => 'representant_id', 'foreign' => 'id', 'onDelete' => 'CASCADE')); } }