setTableName('dotaznik'); $this->hasColumn('id', 'integer', null, array( 'type' => 'integer', 'primary' => true, 'autoincrement' => true, )); $this->hasColumn('zakaznik_id', 'integer', null, array( 'type' => 'integer', 'notnull' => true, )); $this->hasColumn('personalista_id', 'integer', null, array( 'type' => 'integer', 'notnull' => true, )); $this->hasColumn('nazev', 'string', 255, array( 'type' => 'string', 'notnull' => true, 'length' => '255', )); $this->hasColumn('uvod_text', 'clob', null, array( 'type' => 'clob', 'notnull' => true, )); $this->hasColumn('email_hlavicka', 'clob', null, array( 'type' => 'clob', 'notnull' => true, )); $this->hasColumn('email_text', 'clob', null, array( 'type' => 'clob', 'notnull' => true, )); $this->hasColumn('email_personalista', 'boolean', null, array( 'type' => 'boolean', 'notnull' => true, 'default' => false, )); $this->hasColumn('zasilat_upominku', 'boolean', null, array( 'type' => 'boolean', 'notnull' => true, 'default' => false, )); $this->hasColumn('zasilat_upominku_dni_predem', 'integer', null, array( 'type' => 'integer', )); $this->hasColumn('text_upominky', 'clob', null, array( 'type' => 'clob', 'notnull' => true, )); $this->hasColumn('policajt', 'float', null, array( 'type' => 'float', )); $this->hasColumn('zobrazit_vysledky_agenture', 'boolean', null, array( 'type' => 'boolean', 'notnull' => true, 'default' => false, )); $this->hasColumn('datum_do', 'timestamp', null, array( 'type' => 'timestamp', )); $this->hasColumn('typ', 'enum', null, array( 'type' => 'enum', 'values' => array( 0 => 'vahove', 1 => 'procento', ), )); $this->hasColumn('kod', 'string', 20, array( 'type' => 'string', 'unique' => true, 'length' => '20', )); $this->option('type', 'InnoDB'); $this->option('collate', 'utf8_unicode_ci'); $this->option('charset', 'utf8'); } public function setUp() { parent::setUp(); $this->hasOne('Zakaznik', array( 'local' => 'zakaznik_id', 'foreign' => 'id')); $this->hasOne('Personalista', array( 'local' => 'personalista_id', 'foreign' => 'id')); $this->hasMany('Kurz as Kurzy', array( 'refClass' => 'DotaznikKurz', 'local' => 'dotaznik_id', 'foreign' => 'kurz_id')); $this->hasMany('Pracovnik as Pracovnici', array( 'refClass' => 'Dotaznik_pracovnik', 'local' => 'dotaznik_id', 'foreign' => 'pracovnik_id')); $this->hasMany('Dotaznik_otazka as Dotaznik_otazka_list', array( 'local' => 'id', 'foreign' => 'dotaznik_id')); $this->hasMany('Dotaznik_pracovnik as Dotaznik_pracovnik_list', array( 'local' => 'id', 'foreign' => 'dotaznik_id')); $this->hasMany('DotaznikKurz as KurzRelations', array( 'local' => 'id', 'foreign' => 'dotaznik_id')); } }