Category: many-to-many

Symfony 4 – ManyToMany – FetchData (ORM Fetch or Repository Query)

I try to fetch data from a ManyToMany relations. I found a lot of videos/posts/blogs on the subject, but I can’t make it work (or understand). I need help. SO ! I’ve “Formation” and “Module” class. Each “Formation” can have…

Symfony ManyToMany how fetch object related to another object

I don’t understand how to access Product related to CartLine. I have two entities CartLine entity: /** * @ORMManyToMany(targetEntity=”AppEntityProduct”, inversedBy=”cartLines”) * @ORMJoinTable(name=”cart_line_product”) */ private $product; public function __construct() { $this->product = new ArrayCollection(); } /** * @return Collection|Product[] */ public…

How i persist data with @ManyToMany Symfony4

I have problem when I want import data (csv) officer with relation ManyToMany Department : the officer (agent in french) are store but the relation are not created (table agent_departement). Agent class : /** * @ORMEntity(repositoryClass=”AppRepositoryAgentRepository”) */ class Agent {…

Could not determine access type for property "category" in class "AppEntityAdminProducts" Error

Could not determine access type for property “category” in class “AppEntityAdminProducts”: The property “category” in class “AppEntityAdminProducts” can be defined with the methods “addCategory()”, “removeCategory()” but the new value must be an array or an instance of Traversable, “AppEntityAdminCategory” given….