setTableName('agentura'); $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('nazev', 'string', 255, array( 'type' => 'string', 'notnull' => true, 'length' => '255', )); $this->hasColumn('email', 'string', 255, array( 'type' => 'string', 'length' => '255', )); $this->hasColumn('login', 'string', 255, array( 'type' => 'string', 'length' => '255', )); $this->hasColumn('heslo', 'string', 255, array( 'type' => 'string', 'notnull' => true, 'length' => '255', )); $this->hasColumn('poznamka', 'clob', null, array( 'type' => 'clob', )); $this->hasColumn('language', 'enum', null, array( 'type' => 'enum', 'values' => array( 0 => 'cs', 1 => 'en', ), 'default' => 'cs', )); $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->hasMany('Lektor as Lektor_list', array( 'local' => 'id', 'foreign' => 'agentura_id')); $this->hasMany('Kurz_beh as Kurz_beh_list', array( 'local' => 'id', 'foreign' => 'agentura_id')); $this->hasMany('Document as Documents', array( 'local' => 'id', 'foreign' => 'agentura_id')); $this->hasMany('DocumentEvent as DocumentEvents', array( 'local' => 'id', 'foreign' => 'agentura_id')); $archivable0 = new Doctrine_Template_Archivable(array( 'expression' => array( 'symfony_context' => 'getUser()->getAttribute(\'archive_level\')', ), )); $this->actAs($archivable0); } }