-1
symfony2 doctrineを使用してデータベースからフィールドを取得するためにAPIを作成しようとしていますが、クエリで結果が返されません。これは私の試みですsymfony doctrineを使用してデータベーステーブルからフィールドを取得します
/**
* @Route("/get/{email}")
*/
public function emailAction($email)
{
$singleresult = $this->getDoctrine()->getRepository('Api3Bundle:Influ')->find($email);
if ($singleresult === null) {
return new View("user not found", Response::HTTP_NOT_FOUND);
}
上記のURLを変更して、uriエンドポイントを呼び出すと、引数の電子メールを返すようにしてください。
私はどのように[お読みください良い質問をしますか?](http://stackoverflow.com/help/how-to-ask)、それに応じて質問を更新してください。 –
- > find($ email)の代わりにfind - > findOneBy(array( 'email' => $ email)) –
ありがとうマチュー... – Float