setTableName('invoice'); $this->hasColumn('user_id', 'integer', null, array( 'type' => 'integer', )); $this->hasColumn('user_name', 'string', 255, array( 'type' => 'string', 'length' => 255, )); $this->hasColumn('user_email', 'string', 255, array( 'type' => 'string', 'length' => 255, )); $this->hasColumn('representant_id', 'integer', null, array( 'type' => 'integer', )); $this->hasColumn('representant_name', 'string', 255, array( 'type' => 'string', 'length' => 255, )); $this->hasColumn('representant_email', 'string', 255, array( 'type' => 'string', 'length' => 255, )); $this->hasColumn('street', 'string', 255, array( 'type' => 'string', 'length' => 255, )); $this->hasColumn('city', 'string', 255, array( 'type' => 'string', 'length' => 255, )); $this->hasColumn('zip', 'string', 255, array( 'type' => 'string', 'length' => 255, )); $this->hasColumn('ic', 'string', 255, array( 'type' => 'string', 'length' => 255, )); $this->hasColumn('dic', 'string', 255, array( 'type' => 'string', 'length' => 255, )); $this->hasColumn('note', 'string', 255, array( 'type' => 'string', 'length' => 255, )); $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' => 'SET NULL')); $this->hasOne('sfGuardUser as Representant', array( 'local' => 'representant_id', 'foreign' => 'id', 'onDelete' => 'SET NULL')); $this->hasMany('InvoiceItem as Items', array( 'local' => 'id', 'foreign' => 'invoice_id')); $timestampable0 = new Doctrine_Template_Timestampable(); $this->actAs($timestampable0); } }