You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$category = $this->getCategoryRepository()->find(1);
foreach ($category->getProducts() as $product) {
$this->getEntityManager()->remove($product);
}
$article = $this->getArticleRepository()->find(1);
$article->setTitle('New Title');
$this->getEntityManager()->flush($article);// flushing article, removing products, but don't touching $category::products
$this->getEntityManager()->flush();// fatal error: A new entity was found through the relationship 'Category#products' that was not configured to cascade persist operations for entity: Product@XXXXX
The text was updated successfully, but these errors were encountered:
The text was updated successfully, but these errors were encountered: