この初心者の質問を前もってお詫びしますが、正しい結果を得るための適切な方法に苦労しています。
私は2つのテーブルを持っています:
sf_guard_user:
Columns
id
name
recipe:
Columns:
id:
user_id:
name:
relations:
sf-guard_user: { local: user_id, foreign: id; foreign_alias: recipes }
レシピ モジュール、indexSuccess: このフォームは、結果をログイン ユーザーのみに限定したい場所です。
これが私のレシピのactions.class.phpファイルです:
public function executeIndex(sfWebRequest $request)
{
$this->recipe = Doctrine_Core::getTable('recipe')
->createQuery('a')
->whereStatement: user_id = logged-in/posted user (this is where I'm struggling with the syntax... do I use a join statement? Or where statement? ...I'm lost. I can get the result I want in basic MySql, but not in DQL)
->execute();
}
どんな助けでも大歓迎です。