亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

更新產品刪除錯誤剛剛創建的數量

更新產品刪除錯誤剛剛創建的數量

PHP
鳳凰求蠱 2022-10-28 16:35:38
我對 API 平臺有疑問。我有一個產品實體和一個數量實體。我為我的 Angular 應用程序使用 API Platform 一個 API。一個產品可以有多個數量,一個數量只能有一個產品。在我的角度形式中,如果我創建一個鏈接到它工作的產品的數量(它是在數據庫中創建的)。之后,當我更新此產品時,這些先前的數量被刪除(即使我已將先前添加的數量的 IRI 添加到更新前的產品數量中)。這是一些代碼:數量.php<?phpnamespace App\Entity;use ApiPlatform\Core\Annotation\ApiResource;use Doctrine\ORM\Mapping as ORM;use Symfony\Component\Serializer\Annotation\Groups;use ApiPlatform\Core\Annotation\ApiFilter;use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\OrderFilter;/** * @ApiResource() * @ApiFilter(OrderFilter::class, properties={"packing": "ASC"}) * @ORM\Entity(repositoryClass="App\Repository\QuantityRepository") */class Quantity{    /**     * @ORM\Id()     * @ORM\GeneratedValue()     * @ORM\Column(type="integer")     */    private $id;    /**     * @ORM\ManyToOne(targetEntity="App\Entity\Product", inversedBy="quantities")     * @ORM\JoinColumn(nullable=false)     */    private $product;    /**     * @ORM\ManyToOne(targetEntity="App\Entity\Ingredient")     * @ORM\JoinColumn(nullable=false)     */    private $ingredient;    /**     * @ORM\ManyToOne(targetEntity="App\Entity\Packing")     * @ORM\JoinColumn(nullable=false)     */    private $packing;    /**     * @ORM\Column(type="string", length=255)     */    private $value;
查看完整描述

1 回答

?
慕妹3242003

TA貢獻1824條經驗 獲得超6個贊

我的錯。與 API 平臺無關。Angular 中的調用順序有誤。對不起,噪音。



查看完整回答
反對 回復 2022-10-28
  • 1 回答
  • 0 關注
  • 104 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號