* @version SVN: $Id: Builder.php 7490 2010-03-29 19:53:27Z jwage $ */ abstract class BaseInvoice extends sfDoctrineRecord { public function setTableDefinition() { $this->setTableName('invoice'); $this->hasColumn('number', 'integer', null, array( 'type' => 'integer', 'notnull' => true, 'unique' => true, )); $this->hasColumn('profile_id', 'integer', null, array( 'type' => 'integer', )); $this->hasColumn('supplier_name', 'string', 255, array( 'type' => 'string', 'length' => 255, )); $this->hasColumn('supplier_ic', 'string', 255, array( 'type' => 'string', 'length' => 255, )); $this->hasColumn('supplier_dic', 'string', 255, array( 'type' => 'string', 'length' => 255, )); $this->hasColumn('supplier_street', 'string', 255, array( 'type' => 'string', 'length' => 255, )); $this->hasColumn('supplier_city', 'string', 255, array( 'type' => 'string', 'length' => 255, )); $this->hasColumn('supplier_zip', 'string', 255, array( 'type' => 'string', 'length' => 255, )); $this->hasColumn('subscriber_name', 'string', 255, array( 'type' => 'string', 'length' => 255, )); $this->hasColumn('subscriber_ic', 'string', 255, array( 'type' => 'string', 'length' => 255, )); $this->hasColumn('subscriber_dic', 'string', 255, array( 'type' => 'string', 'length' => 255, )); $this->hasColumn('subscriber_street', 'string', 255, array( 'type' => 'string', 'length' => 255, )); $this->hasColumn('subscriber_city', 'string', 255, array( 'type' => 'string', 'length' => 255, )); $this->hasColumn('subscriber_zip', 'string', 255, array( 'type' => 'string', 'length' => 255, )); $this->hasColumn('maturity_date', 'date', null, array( 'type' => 'date', 'notnull' => true, )); $this->hasColumn('payment_form', 'string', 255, array( 'type' => 'string', 'length' => 255, )); $this->hasColumn('bank', 'string', 255, array( 'type' => 'string', 'length' => 255, )); $this->hasColumn('account', 'string', 255, array( 'type' => 'string', 'length' => 255, )); $this->hasColumn('is_paid', '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('Profile', array( 'local' => 'profile_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); } }