Subscription::getUserId PHP Method

getUserId() public method

Get the user ID of the subscription.
public getUserId ( ) : integer
return integer
    function getUserId()
    {
        return $this->getData('userId');
    }

Usage Example

Ejemplo n.º 1
0
 protected function redirectToIndex(Subscription $subscription)
 {
     if (!is_null($subscription->getUserId())) {
         $userId = $subscription->getUserId();
         $this->redirect('subscription/index?userId=' . $userId);
     } elseif (!is_null($subscription->getCardId())) {
         $cardId = $subscription->getCardId();
         $this->redirect('subscription/index?cardId=' . $cardId);
     } else {
         // Default goes to user list. Could be card list as well, it doesn't matter.
         $this->redirect('user/index');
     }
 }