我想在实体持久化和更新上添加新的Feed项.我写这个事件监听器(postUpdate是一样的):
public function postPersist(LifecycleEventArgs $args)
{
$entity = $args->getEntity();
$em = $args->getEntityManager();
if ($entity instanceof FeedItemInterface) {
$feed = new FeedEntity();
$feed->setTitle($entity->getFeedTitle());
$feed->setEntity($entity->getFeedEntityId());
$feed->setType($entity->getFeedType());
if($entity->isFeedTranslatable()) {
$feed->getEnTranslation()->setTitle($entity->getFeedTitle('en'));
}
$em->persist($feed);
$em->flush();
}
}
Run Code Online (Sandbox Code Playgroud)
但是我得到了
完整性约束违规:1062重复条目'30 -2'用于键'PRIMARY'
在日志中有两个插入:
INSERT INTO interview_scientificdirection(interview_id,scientificdirection_id)VALUES(?,?)([30,2])INSERT INTO interview_scientificdirection(interview_id,scientificdirection_id)VALUES(?,?)([30,2])
scientificdirection是多对多的关系表,对于我们想要坚持的实体.在前端应用程序一切正常,但在索纳塔管理员我遇到了这个问题:(
我想制作一个基本的2D格斗游戏(不是快节奏也不会有很多很酷的效果.)我可以用jQuery制作它,但我认为它会慢慢运行(据我所知).
任何人都可以给我一个替代闪光灯来开发这个游戏吗?
如何将一些图像转换为 WebP?我想从设备中选择一些图像并将其以 WebP 格式发送到后端(或仅保存到磁盘),但我找不到此问题的任何解决方案。
我找到了image
插件,但它不支持编码为 WebP,仅支持 PNG、JPEG 和其他几种格式。
我应该在Windows上使用哪个C++ IDE?
是否有支持在GNU/Linux服务器上通过SSH进行编辑的IDE?
我有一个非常大的C++项目没有文档和用文本编辑器编辑非常困难=(
c++ ×1
dart ×1
doctrine-orm ×1
flash ×1
flutter ×1
ide ×1
javascript ×1
jquery ×1
ssh ×1
symfony ×1