Check that user has favorited bundles
public hasFavoritedBundle ( |
||
$bundle | ||
return | boolean |
/** * @param Bundle $bundle * @param Developer $developer * @return bool */ public function toggleBundleFavorite(Bundle $bundle, Developer $developer) { if ($developer->hasFavoritedBundle($bundle)) { $bundle->removeFavorer($developer); } else { $bundle->addFavorer($developer); } $this->entityManager->persist($bundle); $this->entityManager->flush(); return $developer->hasFavoritedBundle($bundle); }