* @version SVN: $Id: Builder.php 7490 2010-03-29 19:53:27Z jwage $ */ abstract class BaseInvoiceItem extends sfDoctrineRecord { public function setTableDefinition() { $this->setTableName('invoice_item'); $this->hasColumn('invoice_id', 'integer', null, array( 'type' => 'integer', 'notnull' => true, )); $this->hasColumn('job_id', 'integer', null, array( 'type' => 'integer', )); $this->hasColumn('topjob_id', 'integer', null, array( 'type' => 'integer', )); $this->hasColumn('banner_id', 'integer', null, array( 'type' => 'integer', )); $this->hasColumn('profile_id', 'integer', null, array( 'type' => 'integer', )); $this->hasColumn('text', 'clob', null, array( 'type' => 'clob', )); $this->hasColumn('amount', 'integer', null, array( 'type' => 'integer', 'notnull' => true, 'default' => 1, )); $this->hasColumn('price_one', 'float', null, array( 'type' => 'float', 'notnull' => true, 'default' => 0, )); $this->hasColumn('currency', 'char', 3, array( 'type' => 'char', 'notnull' => false, 'length' => 3, )); $this->hasColumn('dph', 'integer', null, array( 'type' => 'integer', 'notnull' => true, 'default' => 20, )); $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('Job', array( 'local' => 'job_id', 'foreign' => 'id', 'onDelete' => 'SET NULL')); $this->hasOne('TopJob', array( 'local' => 'topjob_id', 'foreign' => 'id', 'onDelete' => 'SET NULL')); $this->hasOne('Banner', array( 'local' => 'banner_id', 'foreign' => 'id', 'onDelete' => 'SET NULL')); $this->hasOne('Profile', array( 'local' => 'profile_id', 'foreign' => 'id', 'onDelete' => 'SET NULL')); } }