setTableName('invoice'); $this->hasColumn('id', 'integer', null, array( 'type' => 'integer', 'primary' => true, 'autoincrement' => true, )); $this->hasColumn('supplier_id', 'integer', null, array( 'type' => 'integer', )); $this->hasColumn('code', 'string', 20, array( 'type' => 'string', 'length' => '20', )); $this->hasColumn('tax_code', 'string', 20, array( 'type' => 'string', 'length' => '20', )); $this->hasColumn('address_street', 'string', 200, array( 'type' => 'string', 'length' => '200', )); $this->hasColumn('address_city', 'string', 200, array( 'type' => 'string', 'length' => '200', )); $this->hasColumn('address_zipcode', 'string', 20, array( 'type' => 'string', 'length' => '20', )); $this->hasColumn('note', 'clob', null, array( 'type' => 'clob', )); $this->option('collate', 'utf8_unicode_ci'); $this->option('charset', 'utf8'); } public function setUp() { $this->hasOne('Supplier', array( 'local' => 'supplier_id', 'foreign' => 'id')); $this->hasMany('Invoice_item as Items', array( 'local' => 'id', 'foreign' => 'invoice_id')); $timestampable0 = new Doctrine_Template_Timestampable(); $auditable0 = new Doctrine_Template_Auditable(array( 'user_id' => array( 'expression' => array( 'symfony_context' => 'getUser()->getGuardUser()->id', ), ), )); $this->actAs($timestampable0); $this->actAs($auditable0); } }