Answer the question
In order to leave comments, you need to log in
Which is more true ArrayCollection or Entity[]?
https://symfony.com/doc/current/doctrine/associati...
I saw how they wrote instead of ArrayCollection Entity[]
/**
* return Products[] // вместо ArrayColelction
*/
public function getProducts()
{
return $this->products;
}
/**
* @ORM\OneToMany(targetEntity="App\Entity\Product", mappedBy="category")
*/
private $products;
public function __construct()
{
$this->products = new ArrayCollection();
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question