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();
 }
Example #2
0
 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;
 }
Example #3
0
 public function unSubscribeTheme(Profile $profile, Theme $subscribe)
 {
     $criteria = ['profileId' => $profile->getId(), 'subscribeId' => $subscribe->getId(), 'subscribeType' => Subscribe::TYPE_THEME];
     return $this->subscribeRepository->unSubscribeByCriteria($criteria);
 }