Forum Linux.pl

Programowanie => PHP, *SQL => Wątek zaczęty przez: w 2010-04-02, 15:23:12

Tytuł: Pobieranie wartości klucza obcego - symphony
Wiadomość wysłana przez: w 2010-04-02, 15:23:12
Chciałbym pobrać wartość author z tabeli articles. Jednakże nie ma to być id ale login user'a. Pracuję na frameworku symphony. Próbowałem to tak zrobić:

class firmActions extends sfActions
{
  public function executeIndex(sfWebRequest $request)
  {
    $this->articles_entriess = Doctrine::getTable('ArticlesEntries')
      ->createQuery('a')
      ->execute();
    $this->users = Doctrine::getTable('Users')
      ->createQuery('a')
      ->execute();
  }

   
      getDescription() ?>
      getCreationDate() ?>
            $author = $articles_entries->getAuthor();
$author_login = $users->find(array($author));
      //$row = Doctrine::getTable ('Users') -> find ($this->getRequest
       ?>
      getCreatedAt() ?>
   
   
 
Wynik:

Cytuj
Warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'Doctrine_Collection::find' was given in /home/tomasz/project/symfony/lib/vendor/lib/escaper/sfOutputEscaperObjectDecorator.class.php on line 64   2010-03-28 11:30:00
Superb   2010-09-17 14:13:00   
Warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'Doctrine_Collection::find' was given in /home/tomasz/project/symfony/lib/vendor/lib/escaper/sfOutputEscaperObjectDecorator.class.php on line 64   2015-12-20 17:15:00

New
Jak powinienem to zrobić poprawnie?