小编Dra*_*tze的帖子

如何收到有关新GitHub问题的通知?

现在,我想念我在GitHub上托管的项目的一些问题.我正在寻找一种告诉我新问题的方法.电子邮件没问题,但只有在我参与特定问题时才会发送.IRC也是一种选择.

对于电子邮件和IRC,谷歌没有任何帮助.这真的不可能吗?

github

28
推荐指数
3
解决办法
8459
查看次数

Symfony2注释继承

在我的项目中,我有一个BaseController类,它实现了我所有控制器使用的几种方法.

现在我想为该基类添加@QueryParam.我的班级看起来像这样:

class DoctrineRESTQueryController extends FOSRestController
{
    /**
     * @QueryParam(name="start",default=0)
     * @QueryParam(name="limit",default=null)
     */
    public function getQueryResponseAction (ParamFetcher $paramFetcher) {

    }
}
Run Code Online (Sandbox Code Playgroud)

现在我的实际控制器从我的基本控制器扩展:

class DefaultController extends DoctrineRESTQueryController {

    /**
     * Retrieves all SI Prefixes in the database
     *
     * @Routing\Route("/siprefix", defaults={"method" = "get","_format" = "json"})
     * @Routing\Method({"GET"})
     * @ApiDoc(output="array<PartKeepr\SiPrefixBundle\Entity\SiPrefix>")
     *
     * @View()
     *
     * {@inheritdoc}
     */
    public function getQueryResponseAction(ParamFetcher $paramFetcher) {
         $paramFetcher->get("start");
    }
}
Run Code Online (Sandbox Code Playgroud)

不幸的是,Symfony2似乎没有从超类继承@QueryParam注释,因为对$ paramFetcher-> get("start")的调用导致异常"No @ QueryParam/@ RequestParam配置参数'start'".

有没有办法使注释继承工作,或任何其他解决方案,所以我不必将@QueryParam添加到我的每个控制器?

php annotations symfony

5
推荐指数
1
解决办法
3232
查看次数

标签 统计

annotations ×1

github ×1

php ×1

symfony ×1