我提前为这个新手问题道歉,但我一直在努力寻找正确的方法来获得正确的结果。
我有两张桌子:
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();
}
任何帮助深表感谢。