Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [doctrine] sub obiekt z tabeli (rel_id, key, value)
mdx
post
Post #1





Grupa: Zarejestrowani
Postów: 27
Pomógł: 0
Dołączył: 7.03.2003
Skąd: Warszawa

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


Czy istnieje w doctrine obsługa tabel w odwróconym wymiarze?
Mam tabelę:

Kod
User:
    tableName: users
    columns:
        id:             { type: integer, unsigned: true, primary: true, autoincrement: true }
        login:          { type: string(20) }

UserProfile:
    tableName: users_profiles
    columns:
        user_id:    { type: integer, unsigned: true, primary: true }
        key:       { type: string(50) }
        value:      { type: string(255) }


zapełnioną danymi:
Kod
User:
    user_1:
        login: user1
        
UserProfile:
    user_1_profile_1:
        key: email
        value: xxx@xxx.pl
    user_1_profile_2:
        key: birthday
        value: 2000-12-02


i chcę się odwołać do emaila przez:
  1. $userTable = Doctrine::getTable('User');
  2. $user = $userTable->find(1);
  3. var_dump($user->profile->email);
  4. //xxx@xxx.pl


Da się to zrobić używając rozwiązań z doctrine?

Ten post edytował mdx 4.09.2009, 11:36:13
Go to the top of the page
+Quote Post

Posty w temacie


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

 



RSS Aktualny czas: 27.09.2025 - 06:40