Skip to content

Commit 3fe88eb

Browse files
committed
the product category must be nullable
1 parent a8ea2d2 commit 3fe88eb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

doctrine/associations.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ the ``Product`` entity (and getter & setter methods):
146146
147147
/**
148148
* @ORM\ManyToOne(targetEntity="App\Entity\Category", inversedBy="products")
149-
* @ORM\JoinColumn(nullable=false)
149+
* @ORM\JoinColumn(nullable=true)
150150
*/
151151
private $category;
152152
@@ -155,7 +155,7 @@ the ``Product`` entity (and getter & setter methods):
155155
return $this->category;
156156
}
157157
158-
public function setCategory(Category $category): self
158+
public function setCategory(?Category $category): self
159159
{
160160
$this->category = $category;
161161

0 commit comments

Comments
 (0)