public function execute()
 {
     $this->checkDefaultApp($this->aid);
     if (isset($this->email) && !Validate::email($this->email)) {
         throw new OpenFBAPIException('Email address "' . $this->email . '" not valid.');
     }
     if (isset($this->phone) && !Validate_US::phoneNumber($this->phone)) {
         throw new OpenFBAPIException('Phone number "' . $this->phone . '" not valid.');
     }
     $friends = array();
     $friendUids = split(',', $this->friends);
     foreach ($friendUids as $friendUid) {
         $friends[] = array('uid' => $friendUid, 'nid' => $this->nid);
         //TODO: Support case where friend is not a user in the deployed network (i.e. in the users table)
     }
     $result = Api_Bo_Subscriptions::createFriendsAppSubscription($this->uid, $this->nid, $this->aid, $this->planid, $this->ccn, $this->cctype, $this->expdate, $friends, $this->firstname, $this->lastname, $this->email, $this->phone);
     return $result;
 }
 public function execute()
 {
     $this->checkDefaultApp($this->aid);
     if (isset($this->email) && !Validate::email($this->email)) {
         throw new OpenFBAPIException('Email address "' . $this->email . '" not valid.');
     }
     if (isset($this->phone) && !Validate_US::phoneNumber($this->phone)) {
         throw new OpenFBAPIException('Phone number "' . $this->phone . '" not valid.');
     }
     $result = Api_Bo_Subscriptions::createAppSubscription($this->uid, $this->nid, $this->aid, $this->planid, $this->ccn, $this->cctype, $this->expdate, $this->firstname, $this->lastname, $this->email, $this->phone);
     return $result;
 }