public function execute() { $results = Api_Bo_Payments::getSubscriptionsByUidAndNidAndAid($this->uid, $this->nid, $this->aid); // If one or more plans were specified, make sure the user is subscribed to one of those plans if (isset($this->plan) && !empty($this->plan)) { return $this->planMatches($results); } // Check if the user's subscription has been paid for by a friend if (count($results) == 0) { $friendresults = Api_Bo_Payments::getFriendSubscriptionsByUidAndNidAndAid($this->uid, $this->nid, $this->aid); if (isset($this->plan) && !empty($this->plan)) { return $this->planMatches($friendresults); } return count($friendresults) == 0 ? false : true; } return count($results) == 0 ? false : true; }