Skip to content

[Doctrine] show attributes for make:entity in association docs #17090

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
Aug 3, 2022
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
20 changes: 8 additions & 12 deletions doctrine/associations.rst
Original file line number Diff line number Diff line change
Expand Up @@ -68,19 +68,16 @@ This will generate your new entity class::

// ...

#[ORM\Entity(repositoryClass: CategoryRepository::class)]
class Category
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private $id;

/**
* @ORM\Column(type="string")
*/
private $name;
#[ORM\Column]
private string $name;

// ... getters and setters
}
Expand Down Expand Up @@ -380,12 +377,11 @@ Now you can see this new code in action! Imagine you're inside a controller::
use App\Entity\Product;
use Doctrine\Persistence\ManagerRegistry;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;

class ProductController extends AbstractController
{
/**
* @Route("/product", name="product")
*/
#[Route('/product', name: 'product')]
public function index(ManagerRegistry $doctrine): Response
{
$category = new Category();
Expand Down