Доктрина 2, как убрать много для многих ассоциаций?

Как вы разбите отношение от многих Для множества таблицы без удаления ничего не удаляя?

Я пробовал:

$getProject = $this->_helper->getDocRepo('Entities\Project')->findOneBy(array('id' => $projectId));
$getCat = $this->_doctrine->getReference('\Entities\Projectcat', $catId);

$getProject->getCategory()->removeElement($getCat);
$this->em->flush();

Мой объект ProjectCat:

/**
 * @ManyToMany(targetEntity="\Entities\Projectcat", cascade={"persist", "remove"})
 * @JoinColumn(name="id", referencedColumnName="id")
 */
protected $getCategory;
9
задан dean jase 4 September 2011 в 17:53
поделиться