I have a table like this:
the idea is that based on the field "allowed_to_copy_id" I will allow items to be copied.
In the above example the items that are in category #1 can be copied ONLY in category 2 (relationship between "id" and "allowed_to_copy_id").
So, in ../Entity/Category.php I have this:
/**
* @ORM\ManyToOne(targetEntity="Category", inversedBy="sourceRestore")
* @ORM\JoinColumn(name="allowed_to_copy_id", referencedColumnName="id")
*/
protected $copyCategory;
Ok, everythins works perfect!
Here's my problem:
I need to allow a category to be copied to one or more categories... So my database must look something like this:
I'm lost at the part where I'm getting my copyCategory object... Logically, I have get + set functions, but I don't get it how to tell to my webapp that now I'm not having only 1 category object... :(
Any ideas?
THank you!