Skip to content

Fix diff syntax #8809

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 5, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions doctrine/associations.rst
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ it *is* possible, by writing clever methods. First, instead of a ``setProducts()
method, create a ``addProduct()`` method::

// src/Entity/Category.php

// ...
class Category
{
Expand All @@ -470,7 +470,7 @@ What about *removing* a ``Product`` from a ``Category``? Add a ``removeProduct()
method::

// src/Entity/Category.php

// ...
class Category
{
Expand All @@ -495,12 +495,12 @@ To make this work, you *now* need to allow ``null`` to be passed to ``Product::s
{
// ...
- public function getCategory(): Category
+ public function getCategory(): ?Category
- public function getCategory(): Category
+ public function getCategory(): ?Category
// ...
- public function setCategory(Category $category)
+ public function setCategory(Category $category = null)
- public function setCategory(Category $category)
+ public function setCategory(Category $category = null)
{
$this->category = $category;
}
Expand All @@ -514,7 +514,7 @@ to be *deleted* if it becomes "orphaned" (i.e. without a ``Category``)? To choos
that behavior, use the `orphanRemoval`_ option inside ``Category``::

// src/Entity/Category.php

// ...

/**
Expand Down