is regarding an association One-To-Many in the same table, but in MongoDB.
class Component
{
...
/**
* @MongoDB\ReferenceMany(
* discriminatorMap={
* "component"="Component"
* },
* inversedBy="components.id",
* cascade={"persist", "remove", "refresh", "merge"}
* )
*
*/
protected $components;
public function __construct()
{
$this->components = new ArrayCollection();
}
/**
* Add components
*
* @param $component
*/
public function addComponents(Component $component)
{
if(!$this->components->contains($component)){
$this->components->add($component);
}
}
...
}
This associates the components me no problem, I look at the collection and actually associates me, but when I try to regain the components, $ this->components is not an ArrayCollection, but a Object Component
any ideas?
It was resolved …