Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> doctrine relacje
josef871
post
Post #1





Grupa: Zarejestrowani
Postów: 16
Pomógł: 0
Dołączył: 30.06.2007

Ostrzeżenie: (0%)
-----


mam istniejąca już bazę danych, więc za pomocą skryptu doctrine robie import tabel. I teraz mam pytanie czy doctrine ustaliło mi relacje, klucze obce między tabelami czy sam musze to zrobić?
Bo jak zaglądam w wygenerowany kod to tam jest coś takiego:

  1. <?php
  2. abstract class BaseFile extends Doctrine_Record
  3. {
  4.  
  5. public function setTableDefinition()
  6. {
  7. $this->setTableName('file');
  8. $this->hasColumn('id', 'integer', 4, array('alltypes' => array( 0 => 'integer', ), 'ntype' => 'int(10) unsigned', 'unsigned' => 1, 'values' => array(), 'primary' => true, 'notnull' => true, 'autoincrement' => true));
  9. $this->hasColumn('name', 'string', 150, array('alltypes' => array( 0 => 'string', ), 'ntype' => 'varchar(150)', 'fixed' => false, 'values' => array(), 'primary' => false, 'notnull' => false, 'autoincrement' => false));
  10. $this->hasColumn('size', 'integer', 8, array('alltypes' => array( 0 => 'integer', ), 'ntype' => 'bigint(20)', 'unsigned' => 0, 'values' => array(), 'primary' => false, 'notnull' => false, 'autoincrement' => false));
  11. $this->hasColumn('modified', 'integer', 8, array('alltypes' => array( 0 => 'integer', ), 'ntype' => 'bigint(20)', 'unsigned' => 0, 'values' => array(), 'primary' => false, 'notnull' => false, 'autoincrement' => false));
  12. $this->hasColumn('type', 'string', 10, array('alltypes' => array( 0 => 'string', ), 'ntype' => 'varchar(10)', 'fixed' => false, 'values' => array(), 'primary' => false, 'notnull' => false, 'autoincrement' => false));
  13. $this->hasColumn('content', 'string', null, array('alltypes' => array( 0 => 'string',  1 => 'clob', ), 'ntype' => 'text', 'fixed' => false, 'values' => array(), 'primary' => false, 'notnull' => false, 'autoincrement' => false));
  14. $this->hasColumn('path', 'string', null, array('alltypes' => array( 0 => 'string',  1 => 'clob', ), 'ntype' => 'text', 'fixed' => false, 'values' => array(), 'primary' => false, 'notnull' => false, 'autoincrement' => false));
  15. }
  16.  
  17. public function setUp()
  18. {
  19. parent::setUp();
  20. }
  21. ?>


nie ma natomiast w setUp() ustalonych relacji, kluczy obcych??
Go to the top of the page
+Quote Post

Posty w temacie
- josef871   doctrine relacje   7.07.2008, 07:34:16


Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 21.08.2025 - 03:43