Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [Symfony] doSelectJoin - błąd
janek9
post 15.10.2009, 12:51:18
Post #1





Grupa: Zarejestrowani
Postów: 121
Pomógł: 2
Dołączył: 22.03.2009

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


Mam glupi problem z ktorym nie moge dac rady. Mam takie 2 tabele w schema:

<
  1. tp_user_award:
  2. id: ~
  3. id_award: { type: integer, foreignTable: tp_award, foreignReference: id }
  4. is_blocked: { type: boolean, default: False }
  5.  
  6. tp_award:
  7. id: { type: integer, primaryKey: true, autoincrement: true }
  8. award: { type: integer, size: 4}


a w TpUserAwardPeer mam tak:

  1. static public function getAwardFromUser($id)
  2. {
  3. $c = new Criteria();
  4.  
  5. $c->add(self::ID_USER, $id);
  6. $c->add(self::IS_BLOCKED, False);
  7.  
  8. return self::doSelectJoinTpAward($c);
  9. }


i w akcji tak:

  1. public function executeIndex(sfWebRequest $request)
  2. {
  3. $award = TpUserAwardPeer::getAwardFromUser($this->getUser()->getGuardUser()->getId());
  4.  
  5. $p = 0;
  6.  
  7. foreach($award as $aw)
  8. {
  9. $p += $aw->getIdAward()->getAward();
  10. }
  11.  
  12. $this->user_award = $p;
  13. }


pokazuje mi ze:

  1. atal error: Call to a member function getAward() on a non-object


co robie takiego zle, ze wyskakuje mi taki blad? Jak mam sie dobrac do Award z tabeli tp_award ?
Go to the top of the page
+Quote Post

Posty w temacie


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 Wersja Lo-Fi Aktualny czas: 12.08.2025 - 05:37