public function unSubscribeTheme(Profile $profile, Theme $theme) { $criteria = ['profile_id' => $profile->getId(), 'theme_id' => $theme->getId(), 'type' => Subscribe::TYPE_THEME]; $subscribe = $this->getSubscribe($criteria); $em = $this->getEntityManager(); $em->remove($subscribe); $em->flush(); }
public function setParent(Theme $parent = null) : self { if ($parent && $this->isPersisted() && $parent->getId() === $this->getId()) { throw new \Exception('Unable to setup parent'); } $this->parent = $parent; return $this; }
public function unSubscribeTheme(Profile $profile, Theme $subscribe) { $criteria = ['profileId' => $profile->getId(), 'subscribeId' => $subscribe->getId(), 'subscribeType' => Subscribe::TYPE_THEME]; return $this->subscribeRepository->unSubscribeByCriteria($criteria); }