Esempio n. 1
0
 /**
  * is the subscription subscribed to the given subscriber
  *
  * @param SubscriptionSubscriber $subscriber
  *
  * @return bool
  */
 public function isSubscribedTo(SubscriptionSubscriber $subscriber)
 {
     return $this->model_id == $subscriber->getSubscriberId() && $this->model_class == $subscriber->getSubscriberModel();
 }
 /**
  * returns all subscriptions for given plans for a subscriber
  *
  * @param SubscriptionSubscriber $subscriber
  * @param array $plans
  *
  * @return array|static[]|Subscription[]|Collection
  */
 public function allBySubscriberForPlans(SubscriptionSubscriber $subscriber, array $plans)
 {
     return $this->subscription->whereModelId($subscriber->getSubscriberId())->whereModelClass($subscriber->getSubscriberModel())->whereIn('plan', $plans)->orderBy('id')->get();
 }