setTableName('invoice_item'); $this->hasColumn('invoice_id', 'integer', null, array( 'type' => 'integer', 'notnull' => true, )); $this->hasColumn('product_id', 'integer', null, array( 'type' => 'integer', 'notnull' => false, )); $this->hasColumn('code', 'string', 255, array( 'type' => 'string', 'notnull' => true, 'length' => 255, )); $this->hasColumn('name', 'string', 255, array( 'type' => 'string', 'notnull' => true, 'length' => 255, )); $this->hasColumn('amount', 'integer', null, array( 'type' => 'integer', 'notnull' => true, )); $this->hasColumn('price', 'float', null, array( 'type' => 'float', 'notnull' => true, )); $this->hasColumn('is_gratis', '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('Invoice', array( 'local' => 'invoice_id', 'foreign' => 'id', 'onDelete' => 'CASCADE')); $this->hasOne('Product', array( 'local' => 'product_id', 'foreign' => 'id', 'onDelete' => 'SET NULL')); $timestampable0 = new Doctrine_Template_Timestampable(); $this->actAs($timestampable0); } }