微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Mercure 在使用 SoftDeleatable 扩展时不更新 DELETE 方法

如何解决Mercure 在使用 SoftDeleatable 扩展时不更新 DELETE 方法

对于一个项目,我使用 Api Platform 和 Mercure。我目前在使用 SoftDeleatable 扩展名时遇到问题。如果没有这个扩展,当我删除一个实体时,Mercure 会收到 DELETE。但是,如果我使用 SoftDeleatable 扩展名,删除是正确完成的,但 Mercure 没有收到 DELETE。

代码实体:

/**
 * @ORM\Entity(repositoryClass=MatchesRepository::class)
 * @Gedmo\SoftDeleteable(fieldName="deletedAt",timeAware=false,hardDelete=false)
 * @ApiResource(
 *     mercure=true,*     attributes={
 *          "normalization_context"={"groups"="read"},*          "denormalization_context"={"groups"="write"}
 *     },*     collectionoperations={
 *         "get",*         "post"={"security"="is_granted('ROLE_USER')"}
 *     },*     itemOperations={
 *         "get",*         "put"={"security"="is_granted('ROLE_ADMIN') or object.owner == user"},*         "delete"={
 *              "security"="is_granted('ROLE_ADMIN') or object.owner == user"
 *          },*     }
 * )
 */
class Matches
{

刚刚添加了 mercure=true 以启用 mercure

PS:我不测试更改 DELETE 函数是否有效,但 SoftDeleatable 正常执行:/

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。